# HG changeset patch # User reimar # Date 1243895110 0 # Node ID fb99e3db8f8b493b2bd314c62ca8197a4ff6bb9a # Parent dbc412fcde45410eaad5347a9a92386714eba679 Switch to avcodec_decode_video2 to allow a hack that makes PNG decode correctly again instead of in CorePNG delta mode. diff -r dbc412fcde45 -r fb99e3db8f8b libmpcodecs/vd_ffmpeg.c --- a/libmpcodecs/vd_ffmpeg.c Mon Jun 01 10:43:41 2009 +0000 +++ b/libmpcodecs/vd_ffmpeg.c Mon Jun 01 22:25:10 2009 +0000 @@ -758,6 +758,7 @@ AVCodecContext *avctx = ctx->avctx; mp_image_t *mpi=NULL; int dr1= ctx->do_dr1; + AVPacket pkt; if(len<=0) return NULL; // skipped frame @@ -778,8 +779,12 @@ mp_msg(MSGT_DECVIDEO, MSGL_DBG2, "vd_ffmpeg data: %04x, %04x, %04x, %04x\n", ((int *)data)[0], ((int *)data)[1], ((int *)data)[2], ((int *)data)[3]); - ret = avcodec_decode_video(avctx, pic, - &got_picture, data, len); + av_init_packet(&pkt); + pkt.data = data; + pkt.size = len; + // HACK: make PNGs decode normally instead of as CorePNG delta frames + pkt.flags = PKT_FLAG_KEY; + ret = avcodec_decode_video2(avctx, pic, &got_picture, &pkt); dr1= ctx->do_dr1; if(ret<0) mp_msg(MSGT_DECVIDEO, MSGL_WARN, "Error while decoding frame!\n");