[vlc-commits] resource: do not destroy vout when starting fails

Rémi Denis-Courmont git at videolan.org
Sun Feb 24 15:03:02 CET 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Feb 24 16:01:58 2019 +0200| [4586ffaf28c0756e48d0fa607083417dda630a2d] | committer: Rémi Denis-Courmont

resource: do not destroy vout when starting fails

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

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

diff --git a/src/input/resource.c b/src/input/resource.c
index 51455e66f8..249337ea57 100644
--- a/src/input/resource.c
+++ b/src/input/resource.c
@@ -399,7 +399,12 @@ vout_thread_t *input_resource_GetVout(input_resource_t *p_resource,
         vlc_mutex_unlock(&p_resource->lock_hold);
     }
 
-    if (vout_Request(cfg, p_resource->p_input) == 0) {
+    if (vout_Request(cfg, p_resource->p_input)) {
+        vlc_mutex_unlock(&p_resource->lock);
+        input_resource_PutVout(p_resource, vout);
+        return NULL;
+    }
+
         vout =  cfg->vout;
         DisplayVoutTitle(p_resource, vout);
 
@@ -418,10 +423,6 @@ vout_thread_t *input_resource_GetVout(input_resource_t *p_resource,
                     .action = VLC_INPUT_EVENT_VOUT_ADDED,
                     .vout = vout,
                 });
-    } else {
-       vout_Close(vout);
-       vout = NULL;
-    }
 out:
     vlc_mutex_unlock( &p_resource->lock );
     return vout;



More information about the vlc-commits mailing list