summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsjambekar <88648501+sjambekar@users.noreply.github.com>2021-08-09 12:01:43 +0530
committerPhilip Langdale <github.philipl@overt.org>2021-08-12 11:14:37 -0700
commitb692c6599a6e3a7331f588a5a1457788ef9b4e75 (patch)
tree4e680e136d201af4bb204435a90390240245bd78
parentacf7ef86d68baf7224e25f4c2ce42b4cd4c35996 (diff)
downloadmpv-b692c6599a6e3a7331f588a5a1457788ef9b4e75.tar.bz2
mpv-b692c6599a6e3a7331f588a5a1457788ef9b4e75.tar.xz
vo_vdpau: Don't treat preemption as an error when reconfiguring
When the VT switch out is triggered, the decode thread (VD) falls back to sw decoding. However, on the VO thread, which is responsible for handling display preemption and presentation, vo_vdpau.c:reconfig() is called. The reconfig() function returned -1 when the check_preemption() returned 0. The vo_reconfig2() (which calls reconfig()) returned -1 in turn which entered into an error handling path. This led to a series of functions calls that ultimately set the in_terminate flag to TRUE. This led the vo_thread to exit which ultimately led to the MPV application exit. The fix is to return 0 instead of -1 after the check_preemption() in the vo_vpdau.c:reconfig(). Returning 0 instead of -1 is not fatal and does not have any side effects. This is confirmed by testing the VT switching behaviour. And as far as the frames that are going to the display are concerned, they are now dropped. Since the display is preempted, it is okay to drop the frames and continue.
-rw-r--r--video/out/vo_vdpau.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c
index 67784941e4..cae28cdd84 100644
--- a/video/out/vo_vdpau.c
+++ b/video/out/vo_vdpau.c
@@ -478,7 +478,17 @@ static int reconfig(struct vo *vo, struct mp_image_params *params)
VdpStatus vdp_st;
if (!check_preemption(vo))
- return -1;
+ {
+ /*
+ * When prempted, leave the reconfig() immediately
+ * without reconfiguring the vo_window and without
+ * initializing the vdpau objects. When recovered
+ * from preemption, if there is a difference between
+ * the VD thread parameters and the VO thread parameters
+ * the reconfig() is triggered again.
+ */
+ return 0;
+ }
VdpChromaType chroma_type = VDP_CHROMA_TYPE_420;
mp_vdpau_get_format(params->imgfmt, &chroma_type, NULL);