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

◆ seek()

bool MayaFlux::IO::SoundFileReader::seek ( const std::vector< uint64_t > &  position)
overridevirtual

Seek to a specific position in the file.

Parameters
positionVector of dimension indices.
Returns
True if seek succeeded.

Implements MayaFlux::IO::FileReader.

Definition at line 325 of file SoundFileReader.cpp.

326{
327 if (position.empty()) {
328 set_error("Empty position vector");
329 return false;
330 }
331 std::unique_lock<std::shared_mutex> lock(m_context_mutex);
332 if (!m_demux || !m_audio) {
333 set_error("File not open");
334 return false;
335 }
336 return seek_internal(m_demux, m_audio, position[0]);
337}
std::shared_ptr< AudioStreamContext > m_audio
Codec + resampler state.
std::shared_mutex m_context_mutex
Guards both context pointers.
bool seek_internal(const std::shared_ptr< FFmpegDemuxContext > &demux, const std::shared_ptr< AudioStreamContext > &audio, uint64_t frame_position)
Seek the demuxer and flush the codec to the given frame position.
void set_error(const std::string &error) const
Set the last error message.
std::shared_ptr< FFmpegDemuxContext > m_demux
Container / format state.

References m_audio, m_context_mutex, m_demux, seek_internal(), and set_error().

+ Here is the call graph for this function: