# HG changeset patch # User reimar # Date 1386515220 0 # Node ID b75ebb89d80318a5f80f904ccc521f857a193997 # Parent 019636d547716b3ad19df1803cb090d77a6fbe19 Workaround VDPAU decode errors on aspect change on NVidia. The NVidia driver seems to expect a decoder reinit on aspect change, otherwise giving a nonsense VDP_STATUS_INVALID_SIZE error. Since decode and display can run out of sync, we do not in fact know when an aspect change will happen during decode but only when we want to display that decoded frame, and with threaded decoding these will differ significantly. So just catch the error and retry decoding instead, this also has the advantage of not affecting (and possibly costing performance) drivers without this issue. diff -r 019636d54771 -r b75ebb89d803 libvo/vo_vdpau.c --- a/libvo/vo_vdpau.c Fri Dec 06 19:37:07 2013 +0000 +++ b/libvo/vo_vdpau.c Sun Dec 08 15:07:00 2013 +0000 @@ -1031,6 +1031,12 @@ return VO_FALSE; vdp_st = vdp_decoder_render(decoder, rndr->render_state->surface, rndr->info, rndr->bitstream_buffers_used, rndr->bitstream_buffers); + if (vdp_st == VDP_STATUS_INVALID_SIZE) { + // reinit to work around a NVidia bug on aspect change + if (!create_vdp_decoder(image_format, vid_width, vid_height, max_refs)) + return VO_FALSE; + vdp_st = vdp_decoder_render(decoder, rndr->render_state->surface, rndr->info, rndr->bitstream_buffers_used, rndr->bitstream_buffers); + } CHECK_ST_WARNING("Failed VDPAU decoder rendering"); return VO_TRUE; }