summaryrefslogtreecommitdiffstats
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2013-12-12 13:42:10 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-12-24 22:22:06 +0100
commitd63e9943615fe4a7dece768e5c91616a7f63283a (patch)
treeb4c00ec7fac0ee31c08e7b6aaf8741d167aecad1 /libavformat/mov.c
parent251c96a70b0d8cc729ded8c09c7b8bfe03f1a138 (diff)
downloadffmpeg-streaming-d63e9943615fe4a7dece768e5c91616a7f63283a.zip
ffmpeg-streaming-d63e9943615fe4a7dece768e5c91616a7f63283a.tar.gz
avformat/mov: Do not compute a grayscale palette for cinepak in mov.
This was never done for avi files, the decoder always produced output no matter if a palette was computed or not. Since a non-standard palette was needed, this simplifies the code. See issue 1067 and ticket #165. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 7ca4f92..abdea9b 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1314,6 +1314,9 @@ static void mov_parse_stsd_video(MOVContext *c, AVIOContext *pb,
/* figure out the palette situation */
color_depth = st->codec->bits_per_coded_sample & 0x1F;
color_greyscale = st->codec->bits_per_coded_sample & 0x20;
+ /* Do not create a greyscale palette for cinepak */
+ if (color_greyscale && st->codec->codec_id == AV_CODEC_ID_CINEPAK)
+ return;
/* if the depth is 2, 4, or 8 bpp, file is palettized */
if ((color_depth == 2) || (color_depth == 4) || (color_depth == 8)) {
@@ -1329,9 +1332,6 @@ static void mov_parse_stsd_video(MOVContext *c, AVIOContext *pb,
color_index = 255;
color_dec = 256 / (color_count - 1);
for (j = 0; j < color_count; j++) {
- if (st->codec->codec_id == AV_CODEC_ID_CINEPAK){
- r = g = b = color_count - 1 - color_index;
- } else
r = g = b = color_index;
sc->palette[j] = (0xFFU << 24) | (r << 16) | (g << 8) | (b);
color_index -= color_dec;
OpenPOWER on IntegriCloud