[MPlayer-cvslog] r36537 - trunk/libvo/vo_vdpau.c

reimar subversion at mplayerhq.hu
Sun Dec 8 16:07:01 CET 2013


Author: reimar
Date: Sun Dec  8 16:07:00 2013
New Revision: 36537

Log:
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.

Modified:
   trunk/libvo/vo_vdpau.c

Modified: trunk/libvo/vo_vdpau.c
==============================================================================
--- trunk/libvo/vo_vdpau.c	Fri Dec  6 20:37:07 2013	(r36536)
+++ trunk/libvo/vo_vdpau.c	Sun Dec  8 16:07:00 2013	(r36537)
@@ -1031,6 +1031,12 @@ static int draw_slice(uint8_t *image[], 
         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;
 }


More information about the MPlayer-cvslog mailing list