Commit dadc8c81 authored by Mirsal Ennaime's avatar Mirsal Ennaime Committed by Rémi Denis-Courmont

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
(cherry picked from commit 3ed48e03b85431f8024389f1b352854f0714ec3c)
Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent 14402695
......@@ -682,25 +682,34 @@ 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