[MPlayer-cvslog] r31796 - trunk/gui/bitmap.c

reimar subversion at mplayerhq.hu
Sun Jul 25 11:22:37 CEST 2010


Author: reimar
Date: Sun Jul 25 11:22:37 2010
New Revision: 31796

Log:
Switch to non-deprecated avcodec_decode_video2 API.

Modified:
   trunk/gui/bitmap.c

Modified: trunk/gui/bitmap.c
==============================================================================
--- trunk/gui/bitmap.c	Sun Jul 25 11:13:43 2010	(r31795)
+++ trunk/gui/bitmap.c	Sun Jul 25 11:22:37 2010	(r31796)
@@ -34,6 +34,7 @@ static int pngRead( unsigned char * fnam
  int             len;
  AVCodecContext *avctx;
  AVFrame        *frame;
+ AVPacket       pkt;
 
  FILE *fp=fopen( fname,"rb" );
  if ( !fp )
@@ -53,7 +54,12 @@ static int pngRead( unsigned char * fnam
  frame = avcodec_alloc_frame();
  avcodec_register_all();
  avcodec_open(avctx, avcodec_find_decoder(CODEC_ID_PNG));
- avcodec_decode_video(avctx, frame, &decode_ok, 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;
+ avcodec_decode_video2(avctx, frame, &decode_ok, &pkt);
  memset(bf, 0, sizeof(*bf));
  switch (avctx->pix_fmt) {
    case PIX_FMT_GRAY8:    bf->BPP =  8; break;


More information about the MPlayer-cvslog mailing list