[vlc-commits] vout: do not create new if reinit failed

Rémi Denis-Courmont git at videolan.org
Sat Jan 26 19:50:42 CET 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Jan 26 19:25:28 2019 +0200| [ed8c01f5a2e6562489d5eeb87d600e7997ed556b] | committer: Rémi Denis-Courmont

vout: do not create new if reinit failed

Reinitializing a video output thread fails either due to unsupported
format is or a critical error such as OOM.

Either way, creating a new video output thread for the same format
right away is unlikely to lead to any good result. It is a waste of
time.

This patch should almost halve the delay in skipping unsupported video
format, when a vout is being reused.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ed8c01f5a2e6562489d5eeb87d600e7997ed556b
---

 src/video_output/video_output.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index bf5959f13b..3b91aac101 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -259,13 +259,12 @@ vout_thread_t *vout_Request(vlc_object_t *object,
 
         vout_IntfReinit(vout);
 
-        if (!vout->p->dead) {
-            msg_Dbg(object, "reusing provided vout");
-            return vout;
+        if (vout->p->dead) {
+            vout_Close(vout);
+            return NULL;
         }
-        vout_Close(vout);
-
-        msg_Warn(object, "cannot reuse provided vout");
+        msg_Dbg(object, "reusing provided vout");
+        return vout;
     }
     return VoutCreate(object, cfg, input);
 }



More information about the vlc-commits mailing list