diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-02-15 08:40:14 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-02-15 22:34:57 +0000 |
| commit | 54d17e98a597334bf1ba2615e3eb6191088f606f (patch) | |
| tree | 83a4f0c1acb2aab41a9cf279bc949474a214951a /src/lib/ffmpeg.cc | |
| parent | 57c49675889c0e0ad8cebece7a60bba08ba782d2 (diff) | |
Support SSA subtitles embedded within FFmpeg files.
Diffstat (limited to 'src/lib/ffmpeg.cc')
| -rw-r--r-- | src/lib/ffmpeg.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/lib/ffmpeg.cc b/src/lib/ffmpeg.cc index 954aff728..29dda1b9e 100644 --- a/src/lib/ffmpeg.cc +++ b/src/lib/ffmpeg.cc @@ -288,6 +288,32 @@ FFmpeg::subtitle_id (AVSubtitle const & sub) return digester.get (); } +bool +FFmpeg::subtitle_is_image (AVSubtitle const & sub) +{ + bool image = false; + bool text = false; + + for (unsigned int i = 0; i < sub.num_rects; ++i) { + switch (sub.rects[i]->type) { + case SUBTITLE_BITMAP: + image = true; + break; + case SUBTITLE_TEXT: + case SUBTITLE_ASS: + text = true; + break; + default: + break; + } + } + + /* We can't cope with mixed image/text in one AVSubtitle */ + DCPOMATIC_ASSERT (!image || !text); + + return image; +} + /** Compute the pts offset to use given a set of audio streams and some video details. * Sometimes these parameters will have just been determined by an Examiner, sometimes * they will have been retrieved from a piece of Content, hence the need for this method |
