Commit 42720931 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

control/media_instance.c: Make sure media_instance_pause() will either, play,...

control/media_instance.c: Make sure media_instance_pause() will either, play, pause, or stop, depending on the whether the input can be paused or is playing.
parent b99b8b1a
...@@ -546,10 +546,18 @@ void libvlc_media_instance_pause( libvlc_media_instance_t *p_mi, ...@@ -546,10 +546,18 @@ void libvlc_media_instance_pause( libvlc_media_instance_t *p_mi,
if( !p_input_thread ) if( !p_input_thread )
return; return;
if( var_GetInteger( p_input_thread, "state" ) == PAUSE_S ) int state = var_GetInteger( p_input_thread, "state" );
input_Control( p_input_thread, INPUT_SET_STATE, PLAYING_S );
else if( state == PLAYING_S )
{
if( libvlc_media_instance_can_pause( p_mi, p_e ) )
input_Control( p_input_thread, INPUT_SET_STATE, PAUSE_S ); input_Control( p_input_thread, INPUT_SET_STATE, PAUSE_S );
else
libvlc_media_instance_stop( p_mi, p_e );
}
else
input_Control( p_input_thread, INPUT_SET_STATE, PLAYING_S );
vlc_object_release( p_input_thread ); vlc_object_release( p_input_thread );
} }
......
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