[vlc-commits] resource: atomically return vout on failure (fixes #22284)

Rémi Denis-Courmont git at videolan.org
Wed May 8 21:37:26 CEST 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed May  8 22:21:52 2019 +0300| [a1924dbd8bb3e3c146ef150191dcf8ffa0be0a59] | committer: Rémi Denis-Courmont

resource: atomically return vout on failure (fixes #22284)

If vout_Request() fails, atomically mark the still stopped vout as free.
This removes a quick hack from 4586ffaf28c0756e48d0fa607083417dda630a2d.

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

 src/input/resource.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/input/resource.c b/src/input/resource.c
index 13b4b97d07..56ce537753 100644
--- a/src/input/resource.c
+++ b/src/input/resource.c
@@ -356,8 +356,11 @@ vout_thread_t *input_resource_GetVout(input_resource_t *p_resource,
     }
 
     if (vout_Request(cfg, p_resource->p_input)) {
+        if (p_resource->p_vout_free == NULL && p_resource->i_vout == 0)
+            p_resource->p_vout_free = vout;
+        else
+            vout_Close(vout);
         vlc_mutex_unlock(&p_resource->lock);
-        input_resource_PutVout(p_resource, cfg->vout);
         return NULL;
     }
 



More information about the vlc-commits mailing list