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 /src/lib/ffmpeg_decoder.cc | |
| parent | 58259f4c7c7f4eb2a8e532cbd45bf39d5aa9a564 (diff) | |
Speculative support for multi-part subtitles (#709).
Diffstat (limited to 'src/lib/ffmpeg_decoder.cc')
| -rw-r--r-- | src/lib/ffmpeg_decoder.cc | 32 |
1 files changed, 16 insertions, 16 deletions
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); |
