static av_cold int msrle_decode_init(AVCodecContext *avctx)
{
MsrleContext *s = avctx->priv_data;
+ int i;
s->avctx = avctx;
avcodec_get_frame_defaults(&s->frame);
s->frame.data[0] = NULL;
+ if (avctx->extradata_size >= AVPALETTE_SIZE)
+ for (i = 0; i < AVPALETTE_SIZE/4; i++)
+ s->pal[i] = 0xFF<<24 | AV_RL32(avctx->extradata+4*i);
+
return 0;
}
s->frame.palette_has_changed = 1;
memcpy(s->pal, pal, AVPALETTE_SIZE);
}
-
/* make the palette available */
memcpy(s->frame.data[1], s->pal, AVPALETTE_SIZE);
}
AVCodec ff_msrle_decoder = {
.name = "msrle",
.type = AVMEDIA_TYPE_VIDEO,
- .id = CODEC_ID_MSRLE,
+ .id = AV_CODEC_ID_MSRLE,
.priv_data_size = sizeof(MsrleContext),
.init = msrle_decode_init,
.close = msrle_decode_end,