[vlc-devel] [PATCH] libvlc: check if we are in the proper state before to send libvlc_MediaPlayerStopped

Pierre d'Herbemont pdherbemont at free.fr
Tue Apr 1 18:42:16 CEST 2008


On Apr 1, 2008, at 4:24 PM, Tanguy Krotoff wrote:
> ---
> src/control/media_player.c |   25 +++++++++++++++----------
> 1 files changed, 15 insertions(+), 10 deletions(-)
>
> diff --git a/src/control/media_player.c b/src/control/media_player.c
> index b59fafe..20faa24 100644
> --- a/src/control/media_player.c
> +++ b/src/control/media_player.c
> @@ -627,6 +627,13 @@ void  
> libvlc_media_player_pause( libvlc_media_player_t *p_mi,
> void libvlc_media_player_stop( libvlc_media_player_t *p_mi,
>                                  libvlc_exception_t *p_e )
> {
> +    input_thread_t * p_input_thread =  
> libvlc_get_input_thread( p_mi, p_e );
> +
> +    if( !p_input_thread )
> +            return;
> +
> +    int state = var_GetInteger( p_input_thread, "state" );

What about using libvlc_media_player_get_state()?

Pierre.



More information about the vlc-devel mailing list