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

reimar subversion at mplayerhq.hu
Sat Nov 5 20:11:21 CET 2011


Author: reimar
Date: Sat Nov  5 20:11:21 2011
New Revision: 34306

Log:
Improve support for reget_buffer, this fixes DR1 with C93 FFmpeg decoder.

Modified:
   trunk/libmpcodecs/vd_ffmpeg.c

Modified: trunk/libmpcodecs/vd_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/vd_ffmpeg.c	Sat Nov  5 19:38:56 2011	(r34305)
+++ trunk/libmpcodecs/vd_ffmpeg.c	Sat Nov  5 20:11:21 2011	(r34306)
@@ -529,8 +529,8 @@ static int get_buffer(AVCodecContext *av
     int type= MP_IMGTYPE_IPB;
     int width= avctx->width;
     int height= avctx->height;
-    // special case to handle reget_buffer without buffer hints
-    if (pic->opaque && pic->data[0] && !pic->buffer_hints)
+    // special case to handle reget_buffer
+    if (pic->opaque && pic->data[0] && (!pic->buffer_hints || pic->buffer_hints & FF_BUFFER_HINTS_REUSABLE))
         return 0;
     avcodec_align_dimensions(avctx, &width, &height);
 //printf("get_buffer %d %d %d\n", pic->reference, ctx->ip_count, ctx->b_count);
@@ -541,16 +541,16 @@ static int get_buffer(AVCodecContext *av
         if (pic->buffer_hints & FF_BUFFER_HINTS_READABLE)
             flags |= MP_IMGFLAG_READABLE;
         if (pic->buffer_hints & FF_BUFFER_HINTS_PRESERVE) {
-            type = MP_IMGTYPE_STATIC;
+            type = MP_IMGTYPE_IP;
             flags |= MP_IMGFLAG_PRESERVE;
         }
         if (pic->buffer_hints & FF_BUFFER_HINTS_REUSABLE) {
-            type = MP_IMGTYPE_STATIC;
+            type = MP_IMGTYPE_IP;
             flags |= MP_IMGFLAG_PRESERVE;
         }
         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");
+        mp_msg(MSGT_DECVIDEO, MSGL_DBG2, type == MP_IMGTYPE_IP ? "using IP\n" : "using TEMP\n");
     } else {
         if(!pic->reference){
             ctx->b_count++;


More information about the MPlayer-cvslog mailing list