Commit 3ed48e03 authored by Mirsal Ennaime's avatar Mirsal Ennaime

dbus: Fix code style and add missing decref on error path

 * Add missing call to vlc_object_release() in MarshalMetadata
 * Separate code paths with empty lines
 * Fix bracket position in if blocks
parent 5460e18e
......@@ -679,24 +679,33 @@ static int
MarshalMetadata( intf_thread_t *p_intf, DBusMessageIter *container )
{
DBusMessageIter a;
input_item_t *p_item = 0;
input_thread_t *p_input = NULL;
input_item_t *p_item = NULL;
input_thread_t *p_input;
if( ( p_input = playlist_CurrentInput( p_intf->p_sys->p_playlist ) ) ) {
if( ( p_input = playlist_CurrentInput( p_intf->p_sys->p_playlist ) ) )
{
p_item = input_GetItem( p_input );
if( p_item ) {
if( p_item )
{
int result = GetInputMeta( p_item, container );
if (result != VLC_SUCCESS)
{
vlc_object_release( (vlc_object_t*) p_input );
return result;
}
}
vlc_object_release( (vlc_object_t*) p_input );
}
if (!p_item) {
if (!p_item)
{
// avoid breaking the type marshalling
if( !dbus_message_iter_open_container( container, DBUS_TYPE_ARRAY, "{sv}", &a ) ||
!dbus_message_iter_close_container( container, &a ) ) {
!dbus_message_iter_close_container( container, &a ) )
return VLC_ENOMEM;
}
}
return VLC_SUCCESS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment