if (frame < _decoded.frame || end > (_decoded.frame + length * 4)) {
/* Either we have no decoded data, or what we do have is a long way from what we want: seek */
- seek (ContentTime::from_frames (frame, _content->resampled_frame_rate()), accurate);
+ _decoder->seek (ContentTime::from_frames (frame, _content->resampled_frame_rate()), accurate);
}
/* Offset of the data that we want from the start of _decoded.audio
void
FFmpegDecoder::seek (ContentTime time, bool accurate)
{
- video->seek (time, accurate);
- audio->seek (time, accurate);
- subtitle->seek (time, accurate);
+ if (video) {
+ video->seek (time, accurate);
+ }
+
+ if (audio) {
+ audio->seek (time, accurate);
+ }
+
+ if (subtitle) {
+ subtitle->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.
/* Seek if what we want is before what we have, or a more than a little bit after */
if (subs.empty() || sp.back().to < subs.front().period().from || sp.front().from > (subs.back().period().to + ContentTime::from_seconds (1))) {
- seek (sp.front().from, true);
+ _parent->seek (sp.front().from, true);
}
/* Now enough pass() calls will either:
_log->log (String::compose ("VD has request for %1", frame), LogEntry::TYPE_DEBUG_DECODE);
if (_decoded.empty() || frame < _decoded.front().frame || frame > (_decoded.back().frame + 1)) {
- seek (ContentTime::from_frames (frame, _content->active_video_frame_rate()), accurate);
+ _parent->seek (ContentTime::from_frames (frame, _content->active_video_frame_rate()), accurate);
}
list<ContentVideo> dec;