MayaFlux 0.3.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ close()

void MayaFlux::IO::SoundFileReader::close ( )
overridevirtual

Close the currently open file and release resources.

Implements MayaFlux::IO::FileReader.

Definition at line 167 of file SoundFileReader.cpp.

168{
169 std::unique_lock<std::shared_mutex> lock(m_context_mutex);
170 m_audio.reset();
171 m_demux.reset();
173 m_filepath.clear();
174 {
175 std::lock_guard<std::mutex> ml(m_metadata_mutex);
176 m_cached_metadata.reset();
177 m_cached_regions.clear();
178 }
179}
std::shared_ptr< AudioStreamContext > m_audio
Codec + resampler state.
std::shared_mutex m_context_mutex
Guards both context pointers.
std::mutex m_metadata_mutex
Mutex for thread-safe metadata access.
std::atomic< uint64_t > m_current_frame_position
Current frame position for reading.
std::optional< FileMetadata > m_cached_metadata
Cached file metadata.
std::vector< FileRegion > m_cached_regions
Cached file regions (markers, loops, etc.).
std::string m_filepath
Path to the currently open file.
std::shared_ptr< FFmpegDemuxContext > m_demux
Container / format state.

References m_audio, m_cached_metadata, m_cached_regions, m_context_mutex, m_current_frame_position, m_demux, m_filepath, and m_metadata_mutex.

Referenced by ~SoundFileReader().

+ Here is the caller graph for this function: