# HG changeset patch # User reimar # Date 1379356546 0 # Node ID 46bc86e725af15db96e7612904ac8b528c07196b # Parent d637c5e698f0647aaea796232491002b2d850692 Add hack/workaround for FFmpeg offering pixfmts not valid for the selected codec. Fixes crashes with -vc ffmpeg12vdpau. diff -r d637c5e698f0 -r 46bc86e725af libmpcodecs/vd_ffmpeg.c --- a/libmpcodecs/vd_ffmpeg.c Mon Sep 16 01:46:25 2013 +0000 +++ b/libmpcodecs/vd_ffmpeg.c Mon Sep 16 18:35:46 2013 +0000 @@ -1081,6 +1081,10 @@ 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);