audio.reset (new AudioDecoder (this, c->audio, log, fast));
}
- if (c->subtitle) {
+ if (c->only_text()) {
/* XXX: this time here should be the time of the first subtitle, not 0 */
- subtitle.reset (new TextDecoder (this, c->subtitle, log, ContentTime()));
+ text.push_back (shared_ptr<TextDecoder> (new TextDecoder (this, c->only_text(), log, ContentTime())));
}
_next_time.resize (_format_context->nb_streams);
if (_video_stream && si == _video_stream.get() && !video->ignore()) {
decode_video_packet ();
- } else if (fc->subtitle_stream() && fc->subtitle_stream()->uses_index(_format_context, si) && !subtitle->ignore()) {
+ } else if (fc->subtitle_stream() && fc->subtitle_stream()->uses_index(_format_context, si) && !only_text()->ignore()) {
decode_subtitle_packet ();
} else {
decode_audio_packet ();
if (i->second != AV_NOPTS_VALUE) {
double const pts = i->second * av_q2d (_format_context->streams[_video_stream.get()]->time_base) + _pts_offset.seconds ();
+
video->emit (
shared_ptr<ImageProxy> (new RawImageProxy (image)),
- llrint (pts * _ffmpeg_content->active_video_frame_rate ())
+ llrint(pts * _ffmpeg_content->active_video_frame_rate())
);
} else {
LOG_WARNING_NC ("Dropping frame without PTS");
/* Stop any current subtitle, either at the time it was supposed to stop, or now if now is sooner */
if (_have_current_subtitle) {
if (_current_subtitle_to) {
- subtitle->emit_stop (min(*_current_subtitle_to, subtitle_period(sub).from + _pts_offset));
+ only_text()->emit_stop (min(*_current_subtitle_to, subtitle_period(sub).from + _pts_offset));
} else {
- subtitle->emit_stop (subtitle_period(sub).from + _pts_offset);
+ only_text()->emit_stop (subtitle_period(sub).from + _pts_offset);
}
_have_current_subtitle = false;
}
}
if (_current_subtitle_to) {
- subtitle->emit_stop (*_current_subtitle_to);
+ only_text()->emit_stop (*_current_subtitle_to);
}
avsubtitle_free (&sub);
static_cast<double> (rect->h) / target_height
);
- subtitle->emit_bitmap_start (from, image, scaled_rect);
+ only_text()->emit_bitmap_start (from, image, scaled_rect);
}
void
);
BOOST_FOREACH (sub::Subtitle const & i, sub::collect<list<sub::Subtitle> > (raw)) {
- subtitle->emit_plain_start (from, i);
+ only_text()->emit_plain_start (from, i);
}
}