using boost::dynamic_pointer_cast;
using dcp::Size;
-FFmpegDecoder::FFmpegDecoder (shared_ptr<const FFmpegContent> c, shared_ptr<Log> log)
+FFmpegDecoder::FFmpegDecoder (shared_ptr<const FFmpegContent> c, shared_ptr<Log> log, bool fast)
: FFmpeg (c)
, _log (log)
, _have_current_subtitle (false)
}
if (c->audio) {
- audio.reset (new AudioDecoder (this, c->audio, log));
+ audio.reset (new AudioDecoder (this, c->audio, log, fast));
}
if (c->subtitle) {
- subtitle.reset (new SubtitleDecoder (this, c->subtitle, log));
+ /* XXX: this time here should be the time of the first subtitle, not 0 */
+ subtitle.reset (new SubtitleDecoder (this, c->subtitle, log, ContentTime()));
}
_next_time.resize (_format_context->nb_streams);
_have_current_subtitle = true;
if (sub_period.to) {
_current_subtitle_to = *sub_period.to + _pts_offset;
+ } else {
+ _current_subtitle_to = optional<ContentTime>();
}
for (unsigned int i = 0; i < sub.num_rects; ++i) {
}
}
+ if (_current_subtitle_to) {
+ subtitle->emit_stop (*_current_subtitle_to);
+ }
+
avsubtitle_free (&sub);
}