[vlc-devel] commit: Revert "libvlc: check if we are in the proper state before to send libvlc_MediaPlayerStopped " (Pierre d'Herbemont )

git version control git at videolan.org
Fri Apr 4 14:30:50 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Fri Apr  4 14:31:07 2008 +0200| [417e2db8e9061d4b5e9e105b883a86a70f122b6e]

Revert "libvlc: check if we are in the proper state before to send libvlc_MediaPlayerStopped"

This reverts commit c25f5114ce35167be8cc4112dda08a189dfc24e9.

This patch miss a vlc_object_release on p_input_thread.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=417e2db8e9061d4b5e9e105b883a86a70f122b6e
---

 src/control/media_player.c |   25 ++++++++++---------------
 1 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/src/control/media_player.c b/src/control/media_player.c
index 20faa24..b59fafe 100644
--- a/src/control/media_player.c
+++ b/src/control/media_player.c
@@ -627,13 +627,6 @@ 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" );
-
     if( p_mi->b_own_its_input_thread )
     {
         vlc_mutex_lock( &p_mi->object_lock );
@@ -642,18 +635,20 @@ void libvlc_media_player_stop( libvlc_media_player_t *p_mi,
     }
     else
     {
+        input_thread_t * p_input_thread = libvlc_get_input_thread( p_mi, p_e );
+
+        if( !p_input_thread )
+            return;
+
         input_StopThread( p_input_thread );
         vlc_object_release( p_input_thread );
     }
 
-    if( state == PLAYING_S || state == PAUSE_S )
-    {
-        /* Send a stop notification event */
-        libvlc_event_t event;
-        libvlc_media_set_state( p_mi->p_md, libvlc_Stopped, NULL );
-        event.type = libvlc_MediaPlayerStopped;
-        libvlc_event_send( p_mi->p_event_manager, &event );
-    }
+    /* Send a stop notification event */
+    libvlc_event_t event;
+    libvlc_media_set_state( p_mi->p_md, libvlc_Stopped, NULL);
+    event.type = libvlc_MediaPlayerStopped;
+    libvlc_event_send( p_mi->p_event_manager, &event );
 }
 
 /**************************************************************************




More information about the vlc-devel mailing list