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).
This commit is contained in:
Uoti Urpala 2010-10-29 18:38:22 +03:00
parent 8115fedc97
commit 3acf2eb563
1 changed files with 4 additions and 2 deletions

View File

@ -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;