summaryrefslogtreecommitdiff
path: root/libavcodec/tscc.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/tscc.c
parent4de339e219908ff44cbb1d823edeeead3b8facda (diff)
downloadffmpeg-2d8591c27e2dc582a7020e2580e16278dbfbddff.tar.gz
make containers pass palette change in AVPacket
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/tscc.c')
-rw-r--r--libavcodec/tscc.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libavcodec/tscc.c b/libavcodec/tscc.c
index f69597369a..bd05f02a61 100644
--- a/libavcodec/tscc.c
+++ b/libavcodec/tscc.c
@@ -60,6 +60,8 @@ typedef struct TsccContext {
unsigned char* decomp_buf;
int height;
z_stream zstream;
+
+ uint32_t pal[256];
} CamtasiaContext;
/*
@@ -111,11 +113,13 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
/* make the palette available on the way out */
if (c->avctx->pix_fmt == PIX_FMT_PAL8) {
- memcpy(c->pic.data[1], c->avctx->palctrl->palette, AVPALETTE_SIZE);
- if (c->avctx->palctrl->palette_changed) {
+ const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
+
+ if (pal) {
c->pic.palette_has_changed = 1;
- c->avctx->palctrl->palette_changed = 0;
+ memcpy(c->pal, pal, AVPALETTE_SIZE);
}
+ memcpy(c->pic.data[1], c->pal, AVPALETTE_SIZE);
}
*data_size = sizeof(AVFrame);