summaryrefslogtreecommitdiffstats
path: root/libavformat/rawutils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-02-18 20:57:32 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-02-19 15:47:33 +0100
commit7ac962af38f0f0adf6dcfb6716faee9729ef8036 (patch)
treedc6b6759716e2b1f7340e6d8c1937c4dc98a1c5d /libavformat/rawutils.c
parent4956dc88d1fee9f4fa8ae0e26cec0593fef68179 (diff)
downloadffmpeg-streaming-7ac962af38f0f0adf6dcfb6716faee9729ef8036.zip
ffmpeg-streaming-7ac962af38f0f0adf6dcfb6716faee9729ef8036.tar.gz
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 <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/rawutils.c')
-rw-r--r--libavformat/rawutils.c5
1 files changed, 3 insertions, 2 deletions
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);
OpenPOWER on IntegriCloud