summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-08-18 23:59:56 +0200
committerwm4 <wm4@nowhere>2013-08-19 01:09:39 +0200
commit72c81aa111423bdf1845893629df35131e3a11c3 (patch)
treefb71dd155a877b7197d6c5f663183ef25f5457f9
parent9f7c01493037b6c9bc3c4809b2c84bc775f53391 (diff)
downloadmpv-72c81aa111423bdf1845893629df35131e3a11c3.tar.bz2
mpv-72c81aa111423bdf1845893629df35131e3a11c3.tar.xz
vdpau: don't try to match codec profiles
Instead, do what MPlayer did all these years. It worked for them, so there's probably no reason to change this. Apparently fixes playback with some files, where the VDPAU decoder does not formally support a profile, but decoding works with a more powerful profile anyway. Though note that MPlayer did this because it couldn't do it in a better way (no decoder reported profiles available when creating the VDPAU decoder), so it's not entirely clear whether this is a good idea. An alterbative implementation might try to map the profiles exactly, and do some fall backs if the exact profile is not available. But this hack-solution works too. Conflicts: video/decode/vdpau.c
-rw-r--r--video/decode/vdpau.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/video/decode/vdpau.c b/video/decode/vdpau.c
index 35d1e1c835..fc8147fe7b 100644
--- a/video/decode/vdpau.c
+++ b/video/decode/vdpau.c
@@ -42,33 +42,22 @@ struct priv {
struct profile_entry {
enum AVCodecID av_codec;
- int ff_profile;
VdpDecoderProfile vdp_profile;
int maxrefs;
};
-#define PE(av_codec_id, ff_profile, vdp_dcoder_profile, maxrefs) \
+#define PE(av_codec_id, vdp_dcoder_profile, maxrefs) \
{AV_CODEC_ID_ ## av_codec_id, \
- FF_PROFILE_ ## ff_profile, \
VDP_DECODER_PROFILE_ ## vdp_dcoder_profile, \
maxrefs}
static const struct profile_entry profiles[] = {
- PE(MPEG1VIDEO, UNKNOWN, MPEG1, 2),
- PE(MPEG2VIDEO, MPEG2_SIMPLE, MPEG2_SIMPLE, 2),
- PE(MPEG2VIDEO, UNKNOWN, MPEG2_MAIN, 2),
- PE(H264, H264_BASELINE, H264_BASELINE, 16),
- PE(H264, H264_CONSTRAINED_BASELINE, H264_BASELINE, 16),
- PE(H264, H264_MAIN, H264_MAIN, 16),
- PE(H264, UNKNOWN, H264_HIGH, 16),
- PE(WMV3, VC1_SIMPLE, VC1_SIMPLE, 2),
- PE(WMV3, VC1_MAIN, VC1_MAIN, 2),
- PE(WMV3, UNKNOWN, VC1_ADVANCED, 2),
- PE(VC1, VC1_SIMPLE, VC1_SIMPLE, 2),
- PE(VC1, VC1_MAIN, VC1_MAIN, 2),
- PE(VC1, UNKNOWN, VC1_ADVANCED, 2),
- PE(MPEG4, MPEG4_SIMPLE, MPEG4_PART2_SP, 2),
- PE(MPEG4, UNKNOWN, MPEG4_PART2_ASP,2),
+ PE(MPEG1VIDEO, MPEG1, 2),
+ PE(MPEG2VIDEO, MPEG2_MAIN, 2),
+ PE(H264, H264_HIGH, 16),
+ PE(WMV3, VC1_MAIN, 2),
+ PE(VC1, VC1_ADVANCED, 2),
+ PE(MPEG4, MPEG4_PART2_ASP,2),
};
// libavcodec absolutely wants a non-NULL render callback
@@ -124,15 +113,11 @@ static bool create_vdp_decoder(struct lavc_ctx *ctx)
const struct profile_entry *pe = NULL;
for (int n = 0; n < MP_ARRAY_SIZE(profiles); n++) {
- if (profiles[n].av_codec == ctx->avctx->codec_id &&
- (profiles[n].ff_profile == ctx->avctx->profile ||
- profiles[n].ff_profile == FF_PROFILE_UNKNOWN))
- {
+ if (profiles[n].av_codec == ctx->avctx->codec_id) {
pe = &profiles[n];
break;
}
}
-
if (!pe) {
mp_msg(MSGT_VO, MSGL_ERR, "[vdpau] Unknown codec!\n");
goto fail;