[Mplayer-cvslog] CVS: main/libmpcodecs vd_ffmpeg.c,1.31,1.32

Michael Niedermayer michael at mplayerhq.hu
Tue Jul 16 02:56:21 CEST 2002


Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv12742

Modified Files:
	vd_ffmpeg.c 
Log Message:
10l (init flags after init ...)


Index: vd_ffmpeg.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vd_ffmpeg.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- vd_ffmpeg.c	15 Jul 2002 21:33:46 -0000	1.31
+++ vd_ffmpeg.c	16 Jul 2002 00:56:12 -0000	1.32
@@ -57,6 +57,8 @@
 
 #include "cfgparser.h"
 
+static void get_buffer(struct AVCodecContext *avctx, int width, int height, int pict_type);
+
 static int lavc_param_workaround_bugs=0;
 static int lavc_param_error_resilience=0;
 static int lavc_param_gray=0;
@@ -77,14 +79,24 @@
     vd_ffmpeg_ctx *ctx = sh->context;
     switch(cmd){
     case VDCTRL_QUERY_FORMAT:
-	if( (*((int*)arg)) == IMGFMT_YV12 ) return CONTROL_TRUE;
-	if( (*((int*)arg)) == IMGFMT_IYUV ) return CONTROL_TRUE;
-	if( (*((int*)arg)) == IMGFMT_I420 ) return CONTROL_TRUE;
-	if( (*((int*)arg)) == IMGFMT_YUY2 && ctx->yuy2_support ) return CONTROL_TRUE;
+        switch(*((int*)arg)){
+        case IMGFMT_YV12:
+        case IMGFMT_IYUV:
+        case IMGFMT_I420:
+            if(ctx->yuy2_support || ctx->yvu9_support) return CONTROL_FALSE;
+            else                                       return CONTROL_TRUE;
+        case IMGFMT_YUY2:
+            if(ctx->yuy2_support) return CONTROL_TRUE;
+                                  return CONTROL_FALSE;
 #if LIBAVCODEC_BUILD >= 4615
-	if( (*((int*)arg)) == IMGFMT_YVU9 && ctx->yvu9_support ) return CONTROL_TRUE;
-#endif
-	return CONTROL_FALSE;
+        case IMGFMT_YVU9:
+            if(ctx->yvu9_support) return CONTROL_TRUE;
+                                  return CONTROL_FALSE;
+#endif
+        default:
+            return CONTROL_FALSE;
+                
+        }
     }
     return CONTROL_UNKNOWN;
 }
@@ -123,6 +135,13 @@
     ctx->avctx = malloc(sizeof(AVCodecContext));
     memset(ctx->avctx, 0, sizeof(AVCodecContext));
     avctx = ctx->avctx;
+
+#if LIBAVCODEC_BUILD > 4615
+    if(ctx->do_dr1){
+        avctx->flags|= CODEC_FLAG_EMU_EDGE | CODEC_FLAG_DR1; 
+        avctx->get_buffer_callback= get_buffer;
+    }
+#endif
     
     avctx->width = sh->disp_w;
     avctx->height= sh->disp_h;
@@ -325,13 +344,6 @@
 	    avctx->draw_horiz_band=draw_slice;
 	}
     }
-
-#if LIBAVCODEC_BUILD > 4615
-    if(dr1){
-        avctx->flags|= CODEC_FLAG_EMU_EDGE | CODEC_FLAG_DR1;
-        avctx->get_buffer_callback= get_buffer;
-    }
-#endif
 
 #if LIBAVCODEC_BUILD > 4603
     avctx->hurry_up=(flags&3)?((flags&2)?2:1):0;




More information about the MPlayer-cvslog mailing list