aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/qpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-04-17 23:36:57 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-04-17 23:43:54 +0200
commitc40798441f47341c310b38e8f329cfb943924faf (patch)
treec23fbec614c59bcf14c7377d1c6ff7abdfa34353 /libavcodec/qpeg.c
parentc96786008172f669e546ca987e7aaa3c3469be71 (diff)
parentfd0c3403f611d31b944216cfa1585a2d28f7f0da (diff)
downloadffmpeg-c40798441f47341c310b38e8f329cfb943924faf.tar.gz
Merge remote branch 'qatar/master'
* qatar/master: ac3dec: fix processing of delta bit allocation information. vc1: fix fate-vc1 after previous commit. wmv3dec: fix playback of complex WMV3 files using simple_idct. make av_dup_packet() more cautious on allocation failures make containers pass palette change in AVPacket introduce side information for AVPacket Politic commits that have not been pulled: Update regtest checksums after revision 6001dad. Replace more FFmpeg references by Libav. Replace references to ffmpeg-devel with libav-devel; fix roundup URL. Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/qpeg.c')
-rw-r--r--libavcodec/qpeg.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/libavcodec/qpeg.c b/libavcodec/qpeg.c
index e4c2291f39..dda5525f2e 100644
--- a/libavcodec/qpeg.c
+++ b/libavcodec/qpeg.c
@@ -30,6 +30,7 @@ typedef struct QpegContext{
AVCodecContext *avctx;
AVFrame pic;
uint8_t *refdata;
+ uint32_t pal[256];
} QpegContext;
static void qpeg_decode_intra(const uint8_t *src, uint8_t *dst, int size,
@@ -256,6 +257,7 @@ static int decode_frame(AVCodecContext *avctx,
AVFrame * const p= (AVFrame*)&a->pic;
uint8_t* outdata;
int delta;
+ const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
if(p->data[0])
avctx->release_buffer(avctx, p);
@@ -274,11 +276,11 @@ static int decode_frame(AVCodecContext *avctx,
}
/* make the palette available on the way out */
- memcpy(a->pic.data[1], a->avctx->palctrl->palette, AVPALETTE_SIZE);
- if (a->avctx->palctrl->palette_changed) {
+ if (pal) {
a->pic.palette_has_changed = 1;
- a->avctx->palctrl->palette_changed = 0;
+ memcpy(a->pal, pal, AVPALETTE_SIZE);
}
+ memcpy(a->pic.data[1], a->pal, AVPALETTE_SIZE);
*data_size = sizeof(AVFrame);
*(AVFrame*)data = a->pic;
@@ -289,10 +291,6 @@ static int decode_frame(AVCodecContext *avctx,
static av_cold int decode_init(AVCodecContext *avctx){
QpegContext * const a = avctx->priv_data;
- if (!avctx->palctrl) {
- av_log(avctx, AV_LOG_FATAL, "Missing required palette via palctrl\n");
- return -1;
- }
a->avctx = avctx;
avctx->pix_fmt= PIX_FMT_PAL8;
a->refdata = av_malloc(avctx->width * avctx->height);