summaryrefslogtreecommitdiff
path: root/libavcodec/pngenc.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2012-06-11 10:57:23 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2012-06-11 10:57:23 +0200
commit37f1a7d51d750f9bdf8bf6aba61f49bd9ae0565c (patch)
tree2ddbb8fde5eb605cd515c7328e418d6a99832acb /libavcodec/pngenc.c
parent20e46aafbd27e2bcd51fb5310757ee920e258634 (diff)
Make png-in-mov QuickTime-compatible for more colour-spaces.
Reported and tested by ami_stuff. See ticket #1191.
Diffstat (limited to 'libavcodec/pngenc.c')
-rw-r--r--libavcodec/pngenc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
index c29435b1a8..7c9e8d5b3e 100644
--- a/libavcodec/pngenc.c
+++ b/libavcodec/pngenc.c
@@ -242,10 +242,12 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
color_type = PNG_COLOR_TYPE_RGB;
break;
case PIX_FMT_RGBA:
+ avctx->bits_per_coded_sample = 32;
bit_depth = 8;
color_type = PNG_COLOR_TYPE_RGB_ALPHA;
break;
case PIX_FMT_RGB24:
+ avctx->bits_per_coded_sample = 24;
bit_depth = 8;
color_type = PNG_COLOR_TYPE_RGB;
break;
@@ -254,6 +256,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
color_type = PNG_COLOR_TYPE_GRAY;
break;
case PIX_FMT_GRAY8:
+ avctx->bits_per_coded_sample = 0x28;
bit_depth = 8;
color_type = PNG_COLOR_TYPE_GRAY;
break;
@@ -262,10 +265,12 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
color_type = PNG_COLOR_TYPE_GRAY_ALPHA;
break;
case PIX_FMT_MONOBLACK:
+ avctx->bits_per_coded_sample =
bit_depth = 1;
color_type = PNG_COLOR_TYPE_GRAY;
break;
case PIX_FMT_PAL8:
+ avctx->bits_per_coded_sample =
bit_depth = 8;
color_type = PNG_COLOR_TYPE_PALETTE;
break;