Mercurial > mplayer.hg
comparison libmpcodecs/vd_ffmpeg.c @ 36353:46bc86e725af
Add hack/workaround for FFmpeg offering pixfmts not valid
for the selected codec.
Fixes crashes with -vc ffmpeg12vdpau.
author | reimar |
---|---|
date | Mon, 16 Sep 2013 18:35:46 +0000 |
parents | 8c3f3493301e |
children | c728ba2a3f70 |
comparison
equal
deleted
inserted
replaced
36352:d637c5e698f0 | 36353:46bc86e725af |
---|---|
1079 int imgfmt; | 1079 int imgfmt; |
1080 sh_video_t *sh = avctx->opaque; | 1080 sh_video_t *sh = avctx->opaque; |
1081 int i; | 1081 int i; |
1082 | 1082 |
1083 for(i=0;fmt[i]!=PIX_FMT_NONE;i++){ | 1083 for(i=0;fmt[i]!=PIX_FMT_NONE;i++){ |
1084 // it is incorrect of FFmpeg to even offer these, filter them out | |
1085 if(!(avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) && | |
1086 (fmt[i] == AV_PIX_FMT_VDPAU_MPEG1 || fmt[i] == AV_PIX_FMT_VDPAU_MPEG2)) | |
1087 continue; | |
1084 imgfmt = pixfmt2imgfmt2(fmt[i], avctx->codec_id); | 1088 imgfmt = pixfmt2imgfmt2(fmt[i], avctx->codec_id); |
1085 if(!IMGFMT_IS_HWACCEL(imgfmt)) continue; | 1089 if(!IMGFMT_IS_HWACCEL(imgfmt)) continue; |
1086 mp_msg(MSGT_DECVIDEO, MSGL_INFO, MSGTR_MPCODECS_TryingPixfmt, i); | 1090 mp_msg(MSGT_DECVIDEO, MSGL_INFO, MSGTR_MPCODECS_TryingPixfmt, i); |
1087 if(init_vo(sh, fmt[i]) >= 0) { | 1091 if(init_vo(sh, fmt[i]) >= 0) { |
1088 break; | 1092 break; |