_pts_offset = {};
}
- if (c->audio) {
+ if (c->has_mapped_audio()) {
audio = make_shared<AudioDecoder>(this, c->audio, fast);
}
decode_and_process_video_packet (packet);
} else if (fc->subtitle_stream() && fc->subtitle_stream()->uses_index(_format_context, si) && !only_text()->ignore()) {
decode_and_process_subtitle_packet (packet);
- } else {
+ } else if (audio) {
decode_and_process_audio_packet (packet);
}
*/
ContentTime from;
from = sub_period.from + _pts_offset;
+ _have_current_subtitle = true;
if (sub_period.to) {
_current_subtitle_to = *sub_period.to + _pts_offset;
} else {
_current_subtitle_to = optional<ContentTime>();
- _have_current_subtitle = true;
}
ContentBitmapText bitmap_text(from);
}
sub::RawSubtitle base;
- auto raw = sub::SSAReader::parse_line (
- base,
- text,
- _ffmpeg_content->video->size().width,
- _ffmpeg_content->video->size().height,
- sub::Colour(1, 1, 1)
- );
+ auto video_size = _ffmpeg_content->video->size();
+ DCPOMATIC_ASSERT(video_size);
+
+ sub::SSAReader::Context context(video_size->width, video_size->height, sub::Colour(1, 1, 1));
+ auto const raw = sub::SSAReader::parse_line(base, text, context);
for (auto const& i: sub::collect<vector<sub::Subtitle>>(raw)) {
only_text()->emit_plain_start (from, i);