if (audio) {
decode_audio_packet ();
- audio->flush ();
}
}
-void
+bool
FFmpegDecoder::pass ()
{
int r = av_read_frame (_format_context, &_packet);
}
flush ();
- return;
+ return true;
}
int const si = _packet.stream_index;
}
av_packet_unref (&_packet);
+ return false;
}
/** @param data pointer to array of pointers to buffers.
void
FFmpegDecoder::seek (ContentTime time, bool accurate)
{
+ Decoder::seek (time, accurate);
+
/* If we are doing an `accurate' seek, we need to use pre-roll, as
we don't really know what the seek will give us.
*/
if (ct < ContentTime ()) {
/* Discard audio data that comes before time 0 */
Frame const remove = min (int64_t (data->frames()), (-ct).frames_ceil(double((*stream)->frame_rate ())));
- data->move (remove, 0, data->frames() - remove);
+ data->move (data->frames() - remove, remove, 0);
data->set_frames (data->frames() - remove);
ct += ContentTime::from_frames (remove, (*stream)->frame_rate ());
}