diff --git a/src/control/audio.c b/src/control/audio.c index 643edf8754e0a035d56f1eac3c2f274ed4e932ee..1500a24db10bc67488d9afa9c2bb0f9abbabe08d 100644 --- a/src/control/audio.c +++ b/src/control/audio.c @@ -148,6 +148,9 @@ int libvlc_audio_get_track( libvlc_input_t *p_input, input_thread_t *p_input_thread = GetInput( p_input, p_e ); int i_track = 0; + if( !p_input_thread ) + return -1; + i_track = var_GetInteger( p_input_thread, "audio-es" ); vlc_object_release( p_input_thread ); @@ -165,6 +168,9 @@ void libvlc_audio_set_track( libvlc_input_t *p_input, int i_track, int i_ret = -1; int i; + if( !p_input_thread ) + return; + var_Change( p_input_thread, "audio-es", VLC_VAR_GETCHOICES, &val_list, NULL ); for( i = 0; i < val_list.p_list->i_count; i++ ) {