From 7ac962af38f0f0adf6dcfb6716faee9729ef8036 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 18 Feb 2016 20:57:32 +0100 Subject: avformat/avienc: Store pal8 palette This can be made more efficient, but first and the main goal of this change is to store it at all Signed-off-by: Michael Niedermayer --- libavformat/rawutils.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libavformat/rawutils.c') diff --git a/libavformat/rawutils.c b/libavformat/rawutils.c index 1e6148d..26ebbb5 100644 --- a/libavformat/rawutils.c +++ b/libavformat/rawutils.c @@ -29,7 +29,8 @@ int ff_reshuffle_raw_rgb(AVFormatContext *s, AVPacket **ppkt, AVCodecContext *en int64_t bpc = enc->bits_per_coded_sample != 15 ? enc->bits_per_coded_sample : 16; int min_stride = (enc->width * bpc + 7) >> 3; int with_pal_size = min_stride * enc->height + 1024; - int size = bpc == 8 && pkt->size == with_pal_size ? min_stride * enc->height : pkt->size; + int contains_pal = bpc == 8 && pkt->size == with_pal_size; + int size = contains_pal ? min_stride * enc->height : pkt->size; int stride = size / enc->height; int padding = expected_stride - FFMIN(expected_stride, stride); int y; @@ -58,7 +59,7 @@ int ff_reshuffle_raw_rgb(AVFormatContext *s, AVPacket **ppkt, AVCodecContext *en } *ppkt = new_pkt; - return 1; + return 1 + contains_pal; fail: av_packet_free(&new_pkt); -- cgit v1.1