X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Fffmpeg_decoder.cc;h=cfaf0361b9ab79da14f4f4ae841a5bd8a243cf9d;hp=77b608fa86b92a7c7734e9a0c1b835aa45c9d5bc;hb=6ef1fc5f40567650ca9ef2b7644e4fdd97640ae6;hpb=1679c3dc40262733f46dda9f4151367bf93f2b76 diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index 77b608fa8..cfaf0361b 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -210,6 +210,9 @@ FFmpegDecoder::deinterleave_audio (shared_ptr stream) const 0, stream->stream(_format_context)->codec->channels, _frame->nb_samples, audio_sample_format (stream), 1 ); + /* XXX: can't we just use _frame->nb_samples directly here? */ + /* XXX: can't we use swr_convert() to do the format conversion? */ + /* Deinterleave and convert to float */ /* total_samples and frames will be rounded down here, so if there are stray samples at the end @@ -626,23 +629,23 @@ FFmpegDecoder::decode_bitmap_subtitle (AVSubtitleRect const * rect, ContentTime #ifdef DCPOMATIC_HAVE_AVSUBTITLERECT_PICT /* Start of the first line in the subtitle */ uint8_t* sub_p = rect->pict.data[0]; - /* sub_p looks up into a BGRA palette which is here + /* 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) */ - uint32_t const * palette = (uint32_t *) rect->pict.data[1]; + uint8_t const * palette = rect->pict.data[1]; #else /* Start of the first line in the subtitle */ uint8_t* sub_p = rect->data[0]; /* sub_p looks up into a BGRA palette which is at rect->data[1]. (first byte B, second G, third R, fourth A) */ + uint8_t const * palette = rect->data[1]; #endif /* And the stream has a map of those palette colours to colours chosen by the user; created a `mapped' palette from those settings. */ map colour_map = ffmpeg_content()->subtitle_stream()->colours (); vector mapped_palette (rect->nb_colors); - uint8_t const * palette = rect->data[1]; for (int i = 0; i < rect->nb_colors; ++i) { RGBA c (palette[2], palette[1], palette[0], palette[3]); map::const_iterator j = colour_map.find (c);