[MPlayer-cvslog] r33322 - in trunk: configure libmpcodecs/vd_ffmpeg.c

ib subversion at mplayerhq.hu
Sun Apr 24 18:13:26 CEST 2011


Author: ib
Date: Sun Apr 24 18:13:25 2011
New Revision: 33322

Log:
Replace usage of AVCodecContext member hurry_up by skip_idct and skip_frame.

AVCodecContext member hurry_up is deprecated in favor of skip_idct and
skip_frame and won't be applicable with libavcodec starting from major
version number 53 by default.

The configure hack FF_API_HURRY_UP=1 to allow further usage of hurry_up is
no longer needed. As a result, usage of a recent standard ffmpeg as shared
library is possible again.

Modified:
   trunk/configure
   trunk/libmpcodecs/vd_ffmpeg.c

Modified: trunk/configure
==============================================================================
--- trunk/configure	Sun Apr 24 12:44:12 2011	(r33321)
+++ trunk/configure	Sun Apr 24 18:13:25 2011	(r33322)
@@ -6870,7 +6870,7 @@ test -d ffmpeg/libavutil ||
   die "MPlayer will not compile without libavutil in the source tree."
 ffmpeg=no
 if test "$ffmpeg_a" = auto ; then
-  test -d ffmpeg/libavutil && ffmpeg_a=yes && ffmpeg=yes && extra_cflags="$extra_cflags -DFF_API_HURRY_UP=1 -DFF_API_MAX_STREAMS=0"
+  test -d ffmpeg/libavutil && ffmpeg_a=yes && ffmpeg=yes && extra_cflags="$extra_cflags -DFF_API_MAX_STREAMS=0"
 elif test "$ffmpeg_so" = auto ; then
   ffmpeg_so=no
   if $_pkg_config --exists libavutil ; then

Modified: trunk/libmpcodecs/vd_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/vd_ffmpeg.c	Sun Apr 24 12:44:12 2011	(r33321)
+++ trunk/libmpcodecs/vd_ffmpeg.c	Sun Apr 24 18:13:25 2011	(r33322)
@@ -103,6 +103,8 @@ static char *lavc_param_skip_frame_str =
 static int lavc_param_threads=1;
 static int lavc_param_bitexact=0;
 static char *lavc_avopt = NULL;
+static enum AVDiscard skip_idct;
+static enum AVDiscard skip_frame;
 
 static const mp_image_t mpi_no_picture =
 {
@@ -351,6 +353,9 @@ static int init(sh_video_t *sh){
         }
     }
 
+    skip_idct = avctx->skip_idct;
+    skip_frame = avctx->skip_frame;
+
     mp_dbg(MSGT_DECVIDEO, MSGL_DBG2, "libavcodec.size: %d x %d\n", avctx->width, avctx->height);
     switch (sh->format) {
     case mmioFOURCC('S','V','Q','3'):
@@ -609,13 +614,13 @@ static int get_buffer(AVCodecContext *av
             type = MP_IMGTYPE_STATIC;
             flags |= MP_IMGFLAG_PRESERVE;
         }
-        flags|=(!avctx->hurry_up && ctx->do_slices) ?
+        flags|=(avctx->skip_idct<=AVDISCARD_DEFAULT && avctx->skip_frame<=AVDISCARD_DEFAULT && ctx->do_slices) ?
                  MP_IMGFLAG_DRAW_CALLBACK:0;
         mp_msg(MSGT_DECVIDEO, MSGL_DBG2, type == MP_IMGTYPE_STATIC ? "using STATIC\n" : "using TEMP\n");
     } else {
         if(!pic->reference){
             ctx->b_count++;
-            flags|=(!avctx->hurry_up && ctx->do_slices) ?
+            flags|=(avctx->skip_idct<=AVDISCARD_DEFAULT && avctx->skip_frame<=AVDISCARD_DEFAULT && ctx->do_slices) ?
                      MP_IMGFLAG_DRAW_CALLBACK:0;
         }else{
             ctx->ip_count++;
@@ -827,7 +832,14 @@ static mp_image_t *decode(sh_video_t *sh
         }
     }
 
-    avctx->hurry_up=(flags&3)?((flags&2)?2:1):0;
+    avctx->skip_idct = skip_idct;
+    avctx->skip_frame = skip_frame;
+
+    if (flags&3) {
+        avctx->skip_frame = AVDISCARD_NONREF;
+        if (flags&2)
+            avctx->skip_idct = AVDISCARD_ALL;
+    }
 
     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]);


More information about the MPlayer-cvslog mailing list