[vlc-commits] Revert "input: create an aout if UI wants to configure audio"

Rémi Denis-Courmont git at videolan.org
Sat Dec 8 23:00:03 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Dec  8 23:58:38 2012 +0200| [3de8fd13f26610b4f5ae4d87cb4e5653b4498c28] | committer: Rémi Denis-Courmont

Revert "input: create an aout if UI wants to configure audio"

Due to mismatched "resource" and "hold" locks, this introduced a race
where more than one audio output gets created.

This reverts commit 4e57bd052e25c0538a6b1d7e83b8370910ef71dd.

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

 src/input/resource.c |    5 -----
 src/playlist/aout.c  |    4 ++++
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/input/resource.c b/src/input/resource.c
index cec078e..25f979b 100644
--- a/src/input/resource.c
+++ b/src/input/resource.c
@@ -387,11 +387,6 @@ audio_output_t *input_resource_HoldAout( input_resource_t *p_resource )
 
     vlc_mutex_lock( &p_resource->lock_hold );
     p_aout = p_resource->p_aout;
-    if( p_aout == NULL )
-    {   /* No audio outputs exist yet. Create an idle one. */
-        p_aout = aout_New( p_resource->p_parent );
-        p_resource->p_aout = p_aout;
-    }
     if( p_aout )
         vlc_object_hold( p_aout );
     vlc_mutex_unlock( &p_resource->lock_hold );
diff --git a/src/playlist/aout.c b/src/playlist/aout.c
index 2ba1273..72c7f0f 100644
--- a/src/playlist/aout.c
+++ b/src/playlist/aout.c
@@ -33,6 +33,10 @@
 
 audio_output_t *playlist_GetAout(playlist_t *pl)
 {
+    /* NOTE: it is assumed that the input resource exists. In practice,
+     * the playlist must have been activated. This is automatic when calling
+     * pl_Get(). FIXME: input resources are deleted at deactivation, this can
+     * be too early. */
     playlist_private_t *sys = pl_priv(pl);
     return input_resource_HoldAout(sys->p_input_resource);
 }



More information about the vlc-commits mailing list