summaryrefslogtreecommitdiffstats
path: root/ext/kate/gstkateutil.c
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2009-07-21 00:54:47 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2009-07-21 01:02:06 +0100
commitced14a1ff7a0a7190be214848d3de5af2ab7b0ad (patch)
tree3a2a3d19ee4759e54d756a49ec676644e7d3d3cd /ext/kate/gstkateutil.c
parentb04587f4f772fc0a166b8a75314cd31a20a6f964 (diff)
downloadgst-plugins-bad-ced14a1ff7a0a7190be214848d3de5af2ab7b0ad.tar.gz
gst-plugins-bad-ced14a1ff7a0a7190be214848d3de5af2ab7b0ad.tar.bz2
gst-plugins-bad-ced14a1ff7a0a7190be214848d3de5af2ab7b0ad.zip
katedec: only put primary language tag in GST_TAG_LANGUAGE
Only put primary language into GST_TAG_LANGUAGE, and convert to lower case, ie. only use "en" of "en_GB". This is per our tag documentation and hence what apps expect. Also add example to kateenc property description so people know a language code is wanted here.
Diffstat (limited to 'ext/kate/gstkateutil.c')
-rw-r--r--ext/kate/gstkateutil.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/kate/gstkateutil.c b/ext/kate/gstkateutil.c
index b8915d70..3d5d3312 100644
--- a/ext/kate/gstkateutil.c
+++ b/ext/kate/gstkateutil.c
@@ -187,9 +187,15 @@ gst_kate_util_decoder_base_chain_kate_packet (GstKateDecoderBase * decoder,
if (decoder->k.ki->language && *decoder->k.ki->language) {
GstTagList *old = decoder->tags, *tags = gst_tag_list_new ();
if (tags) {
+ gchar *lang_code;
+
+ /* en_GB -> en */
+ lang_code = g_ascii_strdown (decoder->k.ki->language, -1);
+ g_strdelimit (lang_code, NULL, '\0');
gst_tag_list_add (tags, GST_TAG_MERGE_APPEND, GST_TAG_LANGUAGE_CODE,
- decoder->k.ki->language, NULL);
- // TODO: category - where should it go ?
+ lang_code, NULL);
+ g_free (lang_code);
+ /* TODO: category - where should it go ? */
decoder->tags =
gst_tag_list_merge (decoder->tags, tags, GST_TAG_MERGE_REPLACE);
gst_tag_list_free (tags);