diff libmpcodecs/vd_ffmpeg.c @ 12033:3dd75c52bf38

use flag for XvMC codec recognition and enable dr1 for fixed version of lavc
author iive
date Tue, 16 Mar 2004 15:34:55 +0000
parents f4537eee7c33
children 0d8462f0c444
line wrap: on
line diff
--- a/libmpcodecs/vd_ffmpeg.c	Tue Mar 16 05:16:58 2004 +0000
+++ b/libmpcodecs/vd_ffmpeg.c	Tue Mar 16 15:34:55 2004 +0000
@@ -194,8 +194,13 @@
 #endif
 
 #ifdef HAVE_XVMC
+
+#ifdef CODEC_CAP_HWACCEL
+    if(lavc_codec->capabilities & CODEC_CAP_HWACCEL){
+#else
     if(lavc_codec->id == CODEC_ID_MPEG2VIDEO_XVMC){
-        printf("vd_ffmpeg: XVMC accelerated MPEG2\n");
+#endif
+        printf("vd_ffmpeg: XVMC accelerated codec\n");
         assert(ctx->do_dr1);//these are must to!
         assert(ctx->do_slices); //it is (vo_)ffmpeg bug if this fails
         avctx->flags|= CODEC_FLAG_EMU_EDGE;//do i need that??!!
@@ -674,10 +679,15 @@
 
     if(len<=0) return NULL; // skipped frame
 
+#if LIBAVCODEC_BUILD < 4707
+
 #ifdef HAVE_XVMC
-// in fact if(!dr1) should be the only condition, but this way we hide an 
-//ffmpeg interlace (mpeg2) bug. use -noslices to avoid it.
-    if( !avctx->xvmc_acceleration )// && (!dr1) )
+    if( !avctx->xvmc_acceleration )
+#endif
+
+#else
+//ffmpeg interlace (mpeg2) bug have been fixed. no need of -noslices
+    if (!dr1)
 #endif
     avctx->draw_horiz_band=NULL;
     avctx->opaque=sh;