MayaFlux 0.4.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 407 of file SoundFileReader.cpp.

408{
409 if (position.empty()) {
410 set_error("Empty position vector");
411 return false;
412 }
413 std::unique_lock<std::shared_mutex> lock(m_context_mutex);
414 if (!m_demux || !m_audio) {
415 set_error("File not open");
416 return false;
417 }
419}
glm::vec3 position
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, position, seek_internal(), and set_error().

+ Here is the call graph for this function: