summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-14 19:24:20 +0100
committerwm4 <wm4@nowhere>2013-11-14 19:51:42 +0100
commit467ad4413e6bf710eeaa7dcd6e5204cfbda0c0ec (patch)
treebab6037e2ffcec761122af66efd6e34781d360d1 /video
parent597a143ec6d0fd42c6d8afdbc96d2eb0720e998b (diff)
downloadmpv-467ad4413e6bf710eeaa7dcd6e5204cfbda0c0ec.tar.bz2
mpv-467ad4413e6bf710eeaa7dcd6e5204cfbda0c0ec.tar.xz
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.
Diffstat (limited to 'video')
-rw-r--r--video/decode/vd_lavc.c6
1 files 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 ||