1
mirror of https://code.videolan.org/videolan/vlc synced 2024-08-27 04:21:53 +02:00

libvlc: do not depend on input thread to obtain the aout

The aout can exist even if the input thread is stopped. This makes
audio-related functions work in case where they would previously fail.
This commit is contained in:
Rémi Denis-Courmont 2012-11-01 18:16:27 +02:00
parent e1eb563f9f
commit 4251a30f52
4 changed files with 8 additions and 13 deletions

View File

@ -669,4 +669,10 @@ VLC_API void input_resource_TerminateVout( input_resource_t * );
*/
VLC_API void input_resource_Terminate( input_resource_t * );
/**
* \return the current audio output if any.
* Use vlc_object_release() to drop the reference.
*/
VLC_API audio_output_t *input_resource_HoldAout( input_resource_t * );
#endif

View File

@ -50,12 +50,7 @@ static audio_output_t *GetAOut( libvlc_media_player_t *mp )
{
assert( mp != NULL );
input_thread_t *p_input = libvlc_get_input_thread( mp );
if( p_input == NULL )
return NULL;
audio_output_t * p_aout = input_GetAout( p_input );
vlc_object_release( p_input );
audio_output_t *p_aout = input_resource_HoldAout( mp->input.p_resource );
if( p_aout == NULL )
libvlc_printerr( "No active audio output" );
return p_aout;

View File

@ -46,13 +46,6 @@ audio_output_t *input_resource_GetAout( input_resource_t * );
*/
void input_resource_PutAout( input_resource_t *, audio_output_t * );
/**
* This function returns the current aout if any.
*
* You must call vlc_object_release on the value returned (if non NULL).
*/
audio_output_t *input_resource_HoldAout( input_resource_t *p_resource );
/**
* This function handles vout request.
*/

View File

@ -208,6 +208,7 @@ input_resource_New
input_resource_Release
input_resource_TerminateVout
input_resource_Terminate
input_resource_HoldAout
input_Start
input_Stop
input_vaControl