[vlc-devel] [PATCH 1/5] Fix Metadata marshalling when sending the PropertiesChanged signal

Alex Merry dev at randomguy3.me.uk
Sun Jan 27 22:25:10 CET 2013


VLC was getting kicked from the D-Bus when a track was stopped, because
it was generating invalid data on the wire when sending the
PropertiesChanged signal for the Metadata property.

This fixes this by simply using the same code as when getting the
property.
---
 modules/control/dbus/dbus_player.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/modules/control/dbus/dbus_player.c b/modules/control/dbus/dbus_player.c
index 5d24af1..b3ee33e 100644
--- a/modules/control/dbus/dbus_player.c
+++ b/modules/control/dbus/dbus_player.c
@@ -888,19 +888,19 @@ PropertiesChangedSignal( intf_thread_t    *p_intf,
 
         if( !strcmp( ppsz_properties[i], "Metadata" ) )
         {
-            input_thread_t *p_input;
-            p_input = playlist_CurrentInput( p_intf->p_sys->p_playlist );
+            playlist_t *p_playlist = p_intf->p_sys->p_playlist;
 
             dbus_message_iter_open_container( &entry,
                                               DBUS_TYPE_VARIANT, "a{sv}",
                                               &variant );
 
-            if( p_input )
-            {
-                input_item_t *p_item = input_GetItem( p_input );
-                GetInputMeta( p_item, &variant );
-                vlc_object_release( p_input );
-            }
+            PL_LOCK;
+            playlist_item_t* p_item =  playlist_CurrentPlayingItem( p_playlist );
+
+            if( p_item )
+                GetInputMeta( p_item->p_input, &variant );
+
+            PL_UNLOCK;
 
             dbus_message_iter_close_container( &entry, &variant );
         }
-- 
1.8.1.1




More information about the vlc-devel mailing list