summaryrefslogtreecommitdiff
path: root/libavcodec/qtrle.c
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2011-04-09 15:49:51 +0200
committerLuca Barbato <lu_zero@gentoo.org>2011-04-15 18:02:05 +0200
commit2d8591c27e2dc582a7020e2580e16278dbfbddff (patch)
tree5e251cc6e974c0b9e2c99b3f6e622b4983e4941a /libavcodec/qtrle.c
parent4de339e219908ff44cbb1d823edeeead3b8facda (diff)
make containers pass palette change in AVPacket
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/qtrle.c')
-rw-r--r--libavcodec/qtrle.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c
index a8cc903fcb..e14c306c6b 100644
--- a/libavcodec/qtrle.c
+++ b/libavcodec/qtrle.c
@@ -46,6 +46,7 @@ typedef struct QtrleContext {
const unsigned char *buf;
int size;
+ uint32_t pal[256];
} QtrleContext;
#define CHECK_STREAM_PTR(n) \
@@ -511,12 +512,15 @@ static int qtrle_decode_frame(AVCodecContext *avctx,
}
if(has_palette) {
- /* make the palette available on the way out */
- memcpy(s->frame.data[1], s->avctx->palctrl->palette, AVPALETTE_SIZE);
- if (s->avctx->palctrl->palette_changed) {
+ const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
+
+ if (pal) {
s->frame.palette_has_changed = 1;
- s->avctx->palctrl->palette_changed = 0;
+ memcpy(s->pal, pal, AVPALETTE_SIZE);
}
+
+ /* make the palette available on the way out */
+ memcpy(s->frame.data[1], s->pal, AVPALETTE_SIZE);
}
done: