_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_p looks up into a BGRA palette which is at rect->pict.data[1];
(i.e. first byte B, second G, third R, fourth A)
*/
- auto const palette = rect->pict.data[1];
+ auto const* palette = rect->pict.data[1];
#else
/* Start of the first line in the subtitle */
auto sub_p = rect->data[0];
}
sub::RawSubtitle base;
+ auto video_size = _ffmpeg_content->video->size();
+ DCPOMATIC_ASSERT(video_size);
+
auto raw = sub::SSAReader::parse_line (
base,
text,
- _ffmpeg_content->video->size().width,
- _ffmpeg_content->video->size().height,
+ video_size->width,
+ video_size->height,
sub::Colour(1, 1, 1)
);