Commit a65d213b authored by Thomas Guillem's avatar 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 1d7c5598.
parent a7a70e81
......@@ -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;
}
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment