summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-10-29 18:38:22 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:14:43 +0200
commit3acf2eb56318b0c6cbdeb25b67154ae5e493e7d6 (patch)
tree2f1adf327fb785bce50d025da99e4e8e931a7eaa /libvo
parent8115fedc97871c27fb096d3365fb7a052d42dd01 (diff)
downloadmpv-3acf2eb56318b0c6cbdeb25b67154ae5e493e7d6.tar.bz2
mpv-3acf2eb56318b0c6cbdeb25b67154ae5e493e7d6.tar.xz
vo_vdpau: add extra check for unknown image format
Add a default case for unknown image format in create_vdp_decoder. I think this condition shouldn't currently happen, but it's worth a sanity check. Avoids a compiler warning about vdp_decoder_profile being possibly used uninitialized. Also remove an obsolete #ifdef (should always be true now).
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_vdpau.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libvo/vo_vdpau.c b/libvo/vo_vdpau.c
index af4943ed1b..cff89e0844 100644
--- a/libvo/vo_vdpau.c
+++ b/libvo/vo_vdpau.c
@@ -742,17 +742,19 @@ static int create_vdp_decoder(struct vo *vo, int max_refs)
case IMGFMT_VDPAU_VC1:
vdp_decoder_profile = VDP_DECODER_PROFILE_VC1_ADVANCED;
break;
-#ifdef VDP_DECODER_PROFILE_MPEG4_PART2_ASP
case IMGFMT_VDPAU_MPEG4:
vdp_decoder_profile = VDP_DECODER_PROFILE_MPEG4_PART2_ASP;
break;
-#endif
+ default:
+ mp_msg(MSGT_VO, MSGL_ERR, "[vdpau] Unknown image format!\n");
+ goto fail;
}
vdp_st = vdp->decoder_create(vc->vdp_device, vdp_decoder_profile,
vc->vid_width, vc->vid_height, max_refs,
&vc->decoder);
CHECK_ST_WARNING("Failed creating VDPAU decoder");
if (vdp_st != VDP_STATUS_OK) {
+ fail:
vc->decoder = VDP_INVALID_HANDLE;
vc->decoder_max_refs = 0;
return 0;