diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-05-03 23:21:01 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-05-04 00:42:36 +0100 |
| commit | e5eec6c5e7b96cc6e7697bbf42d3f27546c5ad52 (patch) | |
| tree | cc9e17bc41d50a5b63b561513627cd4e49164a78 /src/lib/ffmpeg_examiner.cc | |
| parent | 18d58dc6984fb2adde029131a7b2e141a5daddbf (diff) | |
Allow build with the Ubuntu 16.04 version of FFmpeg.
Diffstat (limited to 'src/lib/ffmpeg_examiner.cc')
| -rw-r--r-- | src/lib/ffmpeg_examiner.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc index 648660478..2b8b2b743 100644 --- a/src/lib/ffmpeg_examiner.cc +++ b/src/lib/ffmpeg_examiner.cc @@ -249,6 +249,19 @@ FFmpegExaminer::subtitle_packet (AVCodecContext* context, shared_ptr<FFmpegSubti for (unsigned int i = 0; i < sub.num_rects; ++i) { if (sub.rects[i]->type == SUBTITLE_BITMAP) { +#ifdef DCPOMATIC_HAVE_AVSUBTITLERECT_PICT + uint32_t* palette = (uint32_t *) sub.rects[i]->pict.data[1]; + for (int j = 0; j < sub.rects[i]->nb_colors; ++j) { + RGBA rgba ( + (palette[j] & 0x00ff0000) >> 16, + (palette[j] & 0x0000ff00) >> 8, + (palette[j] & 0x000000ff) >> 0, + (palette[j] & 0xff000000) >> 24 + ); + + stream->set_colour (rgba, rgba); + } +#else uint32_t* palette = (uint32_t *) sub.rects[i]->data[1]; for (int j = 0; j < sub.rects[i]->nb_colors; ++j) { RGBA rgba ( @@ -260,6 +273,7 @@ FFmpegExaminer::subtitle_packet (AVCodecContext* context, shared_ptr<FFmpegSubti stream->set_colour (rgba, rgba); } +#endif } } |
