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

Rémi Denis-Courmont remi at remlab.net
Mon Jan 28 10:03:51 CET 2013


On Sun, 27 Jan 2013 21:25:10 +0000, Alex Merry <dev at randomguy3.me.uk>
wrote:
> 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.

I don't mind the patch, but I fail to see how it fixes marshalling in any
way...?

> 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 );
>          }

-- 
Rémi Denis-Courmont
Sent from my collocated server



More information about the vlc-devel mailing list