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

Thomas Guillem git at videolan.org
Tue Nov 10 11:35:37 CET 2020


vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Nov  9 15:10:39 2020 +0100| [adcac94850e6816cfac80ee88fa78aabf605e35b] | 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.

(cherry picked from commit a4a94bb3f942989302d0aebc22f3de8ad897a8ff)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

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

diff --git a/lib/media.c b/lib/media.c
index c780487f5d..b909f32436 100644
--- a/lib/media.c
+++ b/lib/media.c
@@ -272,21 +272,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