diff libmpcodecs/vd_ffmpeg.c @ 33043:04203ae3000c

Always use get_format, reduces usage of CODEC_CAP_HWACCEL* conditions.
author reimar
date Sun, 27 Mar 2011 14:02:32 +0000
parents 5c9771fc80cd
children d2b6fbd11f20
line wrap: on
line diff
--- a/libmpcodecs/vd_ffmpeg.c	Sun Mar 27 13:19:32 2011 +0000
+++ b/libmpcodecs/vd_ffmpeg.c	Sun Mar 27 14:02:32 2011 +0000
@@ -303,10 +303,7 @@
     avctx->codec_type = AVMEDIA_TYPE_VIDEO;
     avctx->codec_id = lavc_codec->id;
 
-#if CONFIG_VDPAU || CONFIG_XVMC
-    if(lavc_codec->capabilities & (CODEC_CAP_HWACCEL_VDPAU | CODEC_CAP_HWACCEL))
-        avctx->get_format = get_format;
-#endif /* CONFIG_VDPAU */
+    avctx->get_format = get_format;
     if(ctx->do_dr1){
         avctx->flags|= CODEC_FLAG_EMU_EDGE;
         avctx->get_buffer= get_buffer;
@@ -975,7 +972,6 @@
     return mpi;
 }
 
-#if CONFIG_XVMC || CONFIG_VDPAU
 static enum PixelFormat get_format(struct AVCodecContext *avctx,
                                     const enum PixelFormat *fmt){
     enum PixelFormat selected_format;
@@ -992,7 +988,8 @@
         }
     }
     selected_format = fmt[i];
+    if (selected_format == PIX_FMT_NONE)
+        selected_format = avcodec_default_get_format(avctx, fmt);
     set_format_params(avctx, selected_format);
     return selected_format;
 }
-#endif /* CONFIG_XVMC || CONFIG_VDPAU */