[vlc-commits] input: create an aout if UI wants to configure audio (fixes #7810)

Rémi Denis-Courmont git at videolan.org
Thu Nov 29 21:31:48 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Nov 29 22:30:41 2012 +0200| [4e57bd052e25c0538a6b1d7e83b8370910ef71dd] | committer: Rémi Denis-Courmont

input: create an aout if UI wants to configure audio (fixes #7810)

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

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

diff --git a/src/input/resource.c b/src/input/resource.c
index 25f979b..cec078e 100644
--- a/src/input/resource.c
+++ b/src/input/resource.c
@@ -387,6 +387,11 @@ 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 72c7f0f..2ba1273 100644
--- a/src/playlist/aout.c
+++ b/src/playlist/aout.c
@@ -33,10 +33,6 @@
 
 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