Commit 99e9f2fa authored by Jean-Paul Saman's avatar Jean-Paul Saman

dbus: Add iso936 language code to meta data information.

parent 62eff4b0
......@@ -57,6 +57,8 @@
#include <vlc_interface.h>
#include <vlc_playlist.h>
#include <vlc_iso_lang.h>
#include <math.h>
#include <assert.h>
......@@ -2268,8 +2270,34 @@ static int GetInputEsMeta( input_item_t * p_item, int32_t i_es,
dbus_message_iter_close_container( &dict_entry, &variant );
free( psz_variant );
}
dbus_message_iter_close_container( &dict, &dict_entry );
if( !strcmp( psz_name, "Language") )
{
const struct iso639_lang_t *code = GetLang_iso936(psz_value);
char *psz_code = strdup("iso936_1");
psz_variant = 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_code );
if( asprintf( &psz_variant, "%s", code->psz_iso639_1 ) != -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_close_container( &dict, &dict_entry );
free( psz_code );
}
}
}
......
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