From 467ad4413e6bf710eeaa7dcd6e5204cfbda0c0ec Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 14 Nov 2013 19:24:20 +0100 Subject: vd_lavc: select correct hw decoder profile for constrained baseline h264 The existing code tried to remove the "extra" profile flags for h264. FF_PROFILE_H264_INTRA doesn't matter for us at all, because it's set only for profiles the vdpau/vaapi APIs don't support. The FF_PROFILE_H264_CONSTRAINED flag on the other hand is added to H264_BASELINE, except that it makes the file a real subset of H264_MAIN and H264_HIGH. Removing that flag would select the BASELINE profile, which appears to be rarely supported by hardware decoders. This means we accidentally rejected perfectly hardware decodable files. Use MAIN for it instead. (vaapi has explicit support for CONSTRAINED_BASELINE, but it seems to be a new thing, and is not reported as supported where I tried. So don't bother to check it, and do the same as on vdpau.) See github issue #204. --- video/decode/vd_lavc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index ab5608942a..aebda8dd70 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -151,8 +151,10 @@ const struct hwdec_profile_entry *hwdec_find_profile( enum AVCodecID codec = ctx->avctx->codec_id; int profile = ctx->avctx->profile; // Assume nobody cares about these aspects of the profile - if (codec == AV_CODEC_ID_H264) - profile &= ~(FF_PROFILE_H264_CONSTRAINED | FF_PROFILE_H264_INTRA); + if (codec == AV_CODEC_ID_H264) { + if (profile == FF_PROFILE_H264_CONSTRAINED_BASELINE) + profile = FF_PROFILE_H264_MAIN; + } for (int n = 0; table[n].av_codec; n++) { if (table[n].av_codec == codec) { if (table[n].ff_profile == FF_PROFILE_UNKNOWN || -- cgit v1.2.3