[vlc-commits] Revert "libvlc_media_player: create the aout when first setting audio options"
Thomas Guillem
git at videolan.org
Fri Jun 26 10:37:08 CEST 2015
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Jun 26 09:08:46 2015 +0200| [a65d213b8b21740bc999d75c424e8879ce924ca0] | committer: Thomas Guillem
Revert "libvlc_media_player: create the aout when first setting audio options"
This leads to very inconsistent behaviour on WASAPI and PulseAudio.
This reverts commit 1d7c55982727b20796e0d5f95434ea02b4e23614.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a65d213b8b21740bc999d75c424e8879ce924ca0
---
lib/audio.c | 17 ++++++-----------
lib/media_player.c | 4 ++++
2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/lib/audio.c b/lib/audio.c
index 262c8d9..7901c64 100644
--- a/lib/audio.c
+++ b/lib/audio.c
@@ -51,17 +51,7 @@ static audio_output_t *GetAOut( libvlc_media_player_t *mp )
audio_output_t *p_aout = input_resource_HoldAout( mp->input.p_resource );
if( p_aout == NULL )
- {
- p_aout = input_resource_GetAout( mp->input.p_resource );
- if( p_aout != NULL )
- {
- input_resource_PutAout( mp->input.p_resource, p_aout );
- p_aout = input_resource_HoldAout( mp->input.p_resource );
- }
- else
- libvlc_printerr( "No active audio output" );
- }
-
+ libvlc_printerr( "No active audio output" );
return p_aout;
}
@@ -143,6 +133,11 @@ int libvlc_audio_output_set( libvlc_media_player_t *mp, const char *psz_name )
/* Forget the existing audio output */
input_resource_ResetAout(mp->input.p_resource);
+ /* Create a new audio output */
+ audio_output_t *aout = input_resource_GetAout(mp->input.p_resource);
+ if( aout != NULL )
+ input_resource_PutAout(mp->input.p_resource, aout);
+
return 0;
}
diff --git a/lib/media_player.c b/lib/media_player.c
index 09e3975..83af6cd 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -599,6 +599,10 @@ libvlc_media_player_new( libvlc_instance_t *instance )
vlc_object_release(mp);
return NULL;
}
+ audio_output_t *aout = input_resource_GetAout(mp->input.p_resource);
+ if( aout != NULL )
+ input_resource_PutAout(mp->input.p_resource, aout);
+
vlc_mutex_init (&mp->input.lock);
mp->i_refcount = 1;
mp->p_event_manager = libvlc_event_manager_new(mp, instance);
More information about the vlc-commits
mailing list