[MPlayer-cvslog] r29340 - trunk/libmpcodecs/vd_ffmpeg.c

reimar subversion at mplayerhq.hu
Tue Jun 2 00:25:11 CEST 2009


Author: reimar
Date: Tue Jun  2 00:25:10 2009
New Revision: 29340

Log:
Switch to avcodec_decode_video2 to allow a hack that makes PNG decode correctly
again instead of in CorePNG delta mode.

Modified:
   trunk/libmpcodecs/vd_ffmpeg.c

Modified: trunk/libmpcodecs/vd_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/vd_ffmpeg.c	Mon Jun  1 12:43:41 2009	(r29339)
+++ trunk/libmpcodecs/vd_ffmpeg.c	Tue Jun  2 00:25:10 2009	(r29340)
@@ -758,6 +758,7 @@ static mp_image_t *decode(sh_video_t *sh
     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 @@ static mp_image_t *decode(sh_video_t *sh
 
     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");


More information about the MPlayer-cvslog mailing list