diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-10-06 09:17:17 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-10-06 09:17:17 +0100 |
| commit | c53bf2c0860f6b0ff583ad9f4bc4c7e86d47fa94 (patch) | |
| tree | a1cfb8ceaea9a5929a404d93118a396677fd36bb | |
| parent | 58259f4c7c7f4eb2a8e532cbd45bf39d5aa9a564 (diff) | |
Speculative support for multi-part subtitles (#709).
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | src/lib/ffmpeg_decoder.cc | 32 |
2 files changed, 21 insertions, 16 deletions
@@ -1,3 +1,8 @@ +2015-10-06 Carl Hetherington <cth@carlh.net> + + * Speculative support for multi-part + bitmap subtitles (#709). + 2015-10-05 Carl Hetherington <cth@carlh.net> * Version 2.4.0 released. diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index c23d56b42..3fdb2f2a9 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -412,8 +412,6 @@ FFmpegDecoder::decode_subtitle_packet () indicate that the previous subtitle should stop. We can ignore it here. */ return; - } else if (sub.num_rects > 1) { - throw DecodeError (_("multi-part subtitles not yet supported")); } /* Subtitle PTS (within the source, not taking into account any of the @@ -430,20 +428,22 @@ FFmpegDecoder::decode_subtitle_packet () period.to = ffmpeg_content()->subtitle_stream()->find_subtitle_to (period.from); } - AVSubtitleRect const * rect = sub.rects[0]; - - switch (rect->type) { - case SUBTITLE_NONE: - break; - case SUBTITLE_BITMAP: - decode_bitmap_subtitle (rect, period); - break; - case SUBTITLE_TEXT: - cout << "XXX: SUBTITLE_TEXT " << rect->text << "\n"; - break; - case SUBTITLE_ASS: - cout << "XXX: SUBTITLE_ASS " << rect->ass << "\n"; - break; + for (unsigned int i = 0; i < sub.num_rects; ++i) { + AVSubtitleRect const * rect = sub.rects[i]; + + switch (rect->type) { + case SUBTITLE_NONE: + break; + case SUBTITLE_BITMAP: + decode_bitmap_subtitle (rect, period); + break; + case SUBTITLE_TEXT: + cout << "XXX: SUBTITLE_TEXT " << rect->text << "\n"; + break; + case SUBTITLE_ASS: + cout << "XXX: SUBTITLE_ASS " << rect->ass << "\n"; + break; + } } avsubtitle_free (&sub); |
