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

reimar subversion at mplayerhq.hu
Mon Sep 16 20:35:46 CEST 2013


Author: reimar
Date: Mon Sep 16 20:35:46 2013
New Revision: 36449

Log:
Add hack/workaround for FFmpeg offering pixfmts not valid
for the selected codec.

Fixes crashes with -vc ffmpeg12vdpau.

Modified:
   trunk/libmpcodecs/vd_ffmpeg.c

Modified: trunk/libmpcodecs/vd_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/vd_ffmpeg.c	Mon Sep 16 03:46:25 2013	(r36448)
+++ trunk/libmpcodecs/vd_ffmpeg.c	Mon Sep 16 20:35:46 2013	(r36449)
@@ -1081,6 +1081,10 @@ static enum AVPixelFormat get_format(str
     int i;
 
     for(i=0;fmt[i]!=PIX_FMT_NONE;i++){
+        // it is incorrect of FFmpeg to even offer these, filter them out
+        if(!(avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) &&
+           (fmt[i] == AV_PIX_FMT_VDPAU_MPEG1 || fmt[i] == AV_PIX_FMT_VDPAU_MPEG2))
+            continue;
         imgfmt = pixfmt2imgfmt2(fmt[i], avctx->codec_id);
         if(!IMGFMT_IS_HWACCEL(imgfmt)) continue;
         mp_msg(MSGT_DECVIDEO, MSGL_INFO, MSGTR_MPCODECS_TryingPixfmt, i);


More information about the MPlayer-cvslog mailing list