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

Tanguy Krotoff tkrotoff at gmail.com
Tue Apr 1 18:51:45 CEST 2008


On Tue, Apr 1, 2008 at 6:42 PM, Pierre d'Herbemont <pdherbemont at free.fr> wrote:
>
>  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()?

I don't know, other functions from media_player.c don't use
libvlc_media_player_get_state().
I wrote the code so it is similar to the rest

-- 
Tanguy Krotoff <tkrotoff at gmail.com>
+33 6 68 42 70 24



More information about the vlc-devel mailing list