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

◆ seek()

bool MayaFlux::IO::FFmpegDemuxContext::seek ( int  stream_index,
int64_t  timestamp 
)

Seek to the nearest keyframe at or before the given timestamp.

Parameters
stream_indexTarget stream index.
timestampTimestamp in the stream's time_base units.
Returns
True on success.

Definition at line 135 of file FFmpegDemuxContext.cpp.

136{
137 if (!format_context)
138 return false;
139
140 int ret = av_seek_frame(format_context, stream_index, timestamp, AVSEEK_FLAG_BACKWARD);
141 if (ret < 0) {
142 m_last_error = "av_seek_frame failed";
143 return false;
144 }
145 return true;
146}
AVFormatContext * format_context
Owned; freed in destructor.

References format_context, and m_last_error.