[vlc-commits] lib: send media_list end event after

Thomas Guillem git at videolan.org
Tue Nov 10 10:45:52 CET 2020


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Nov  9 15:10:39 2020 +0100| [a4a94bb3f942989302d0aebc22f3de8ad897a8ff] | committer: Thomas Guillem

lib: send media_list end event after

That way, users receive the media end status before receiving the
media_list end event.

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

 lib/media.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/lib/media.c b/lib/media.c
index 7881e18f2b..7ab98de7c1 100644
--- a/lib/media.c
+++ b/lib/media.c
@@ -357,21 +357,21 @@ static void send_parsed_changed( libvlc_media_t *p_md,
 
     vlc_mutex_unlock( &p_md->parsed_lock );
 
-        libvlc_media_list_t *p_subitems = media_get_subitems( p_md, false );
-        if( p_subitems != NULL )
-        {
-            /* notify the media list */
-            libvlc_media_list_lock( p_subitems );
-            libvlc_media_list_internal_end_reached( p_subitems );
-            libvlc_media_list_unlock( p_subitems );
-        }
-
     /* Construct the event */
     event.type = libvlc_MediaParsedChanged;
     event.u.media_parsed_changed.new_status = new_status;
 
     /* Send the event */
     libvlc_event_send( &p_md->event_manager, &event );
+
+    libvlc_media_list_t *p_subitems = media_get_subitems( p_md, false );
+    if( p_subitems != NULL )
+    {
+        /* notify the media list */
+        libvlc_media_list_lock( p_subitems );
+        libvlc_media_list_internal_end_reached( p_subitems );
+        libvlc_media_list_unlock( p_subitems );
+    }
 }
 
 /**



More information about the vlc-commits mailing list