Commit a70c8b64 authored by Jean-Paul Saman's avatar Jean-Paul Saman

dbus: Reformat output of Player.GetMetadata() TrackList.GetMetadata()

parent 9e4ce232
......@@ -2206,21 +2206,26 @@ static int GetInputMeta( input_item_t* p_input,
const char *psz_name = p_input->pp_categories[i]->pp_infos[j]->psz_name;
const char *psz_value = p_input->pp_categories[i]->pp_infos[j]->psz_value;
char *psz_variant = NULL;
char *psz_entry = NULL;
dbus_message_iter_open_container( &dict, DBUS_TYPE_DICT_ENTRY,
NULL, &dict_entry );
dbus_message_iter_append_basic( &dict_entry, DBUS_TYPE_STRING,
&psz_cat );
if( asprintf( &psz_variant, "%s : %s", psz_name, psz_value ) != -1 )
if( asprintf( &psz_entry, "%s %s", psz_cat, psz_name ) != -1 )
{
dbus_message_iter_open_container( &dict_entry, DBUS_TYPE_VARIANT,
DBUS_TYPE_STRING_AS_STRING, &variant );
dbus_message_iter_append_basic( &variant,
DBUS_TYPE_STRING, &psz_variant );
dbus_message_iter_close_container( &dict_entry, &variant );
free( psz_variant );
dbus_message_iter_open_container( &dict, DBUS_TYPE_DICT_ENTRY,
NULL, &dict_entry );
dbus_message_iter_append_basic( &dict_entry, DBUS_TYPE_STRING,
&psz_entry );
if( asprintf( &psz_variant, "%s", psz_value ) != -1 )
{
dbus_message_iter_open_container( &dict_entry, DBUS_TYPE_VARIANT,
DBUS_TYPE_STRING_AS_STRING, &variant );
dbus_message_iter_append_basic( &variant,
DBUS_TYPE_STRING, &psz_variant );
dbus_message_iter_close_container( &dict_entry, &variant );
free( psz_variant );
}
}
free( psz_entry );
dbus_message_iter_close_container( &dict, &dict_entry );
}
......
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