[vlc-commits] dbus: Fix code style and add missing decref on error path
Mirsal Ennaime
git at videolan.org
Tue Jan 29 20:06:59 CET 2013
vlc/vlc-2.0 | branch: master | Mirsal Ennaime <mirsal at videolan.org> | Tue Jan 29 14:40:23 2013 +0100| [0dd33c7e08c40f6718272112e78382909dce4a39] | committer: 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)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=0dd33c7e08c40f6718272112e78382909dce4a39
---
modules/control/dbus/dbus_player.c | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/modules/control/dbus/dbus_player.c b/modules/control/dbus/dbus_player.c
index faf3ac4..bd3b93c 100644
--- a/modules/control/dbus/dbus_player.c
+++ b/modules/control/dbus/dbus_player.c
@@ -682,24 +682,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;
More information about the vlc-commits
mailing list