summaryrefslogtreecommitdiffstats
path: root/libavcodec/kmvc.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/kmvc.c
parent4de339e219908ff44cbb1d823edeeead3b8facda (diff)
downloadffmpeg-streaming-2d8591c27e2dc582a7020e2580e16278dbfbddff.zip
ffmpeg-streaming-2d8591c27e2dc582a7020e2580e16278dbfbddff.tar.gz
make containers pass palette change in AVPacket
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/kmvc.c')
-rw-r--r--libavcodec/kmvc.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/libavcodec/kmvc.c b/libavcodec/kmvc.c
index 2671cc6..c41c882 100644
--- a/libavcodec/kmvc.c
+++ b/libavcodec/kmvc.c
@@ -233,6 +233,7 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPa
int i;
int header;
int blocksize;
+ const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
if (ctx->pic.data[0])
avctx->release_buffer(avctx, &ctx->pic);
@@ -264,13 +265,6 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPa
ctx->pic.pict_type = FF_P_TYPE;
}
- /* if palette has been changed, copy it from palctrl */
- if (ctx->avctx->palctrl && ctx->avctx->palctrl->palette_changed) {
- memcpy(ctx->pal, ctx->avctx->palctrl->palette, AVPALETTE_SIZE);
- ctx->setpal = 1;
- ctx->avctx->palctrl->palette_changed = 0;
- }
-
if (header & KMVC_PALETTE) {
ctx->pic.palette_has_changed = 1;
// palette starts from index 1 and has 127 entries
@@ -279,6 +273,11 @@ static int decode_frame(AVCodecContext * avctx, void *data, int *data_size, AVPa
}
}
+ if (pal) {
+ ctx->pic.palette_has_changed = 1;
+ memcpy(ctx->pal, pal, AVPALETTE_SIZE);
+ }
+
if (ctx->setpal) {
ctx->setpal = 0;
ctx->pic.palette_has_changed = 1;
@@ -374,9 +373,6 @@ static av_cold int decode_init(AVCodecContext * avctx)
src += 4;
}
c->setpal = 1;
- if (c->avctx->palctrl) {
- c->avctx->palctrl->palette_changed = 0;
- }
}
avctx->pix_fmt = PIX_FMT_PAL8;
OpenPOWER on IntegriCloud