From 40131326b34f2075b35a4e6ccc0af139cd5080f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 14 Jun 2006 11:28:41 +0000 Subject: [PATCH] gst/matroska/matroska-demux.c: No language specified means the implied language is English according to the matroska ... Original commit message from CVS: * gst/matroska/matroska-demux.c: (gst_matroska_demux_add_stream): No language specified means the implied language is English according to the matroska spec (partially fixes #344708); add some more debug output. --- ChangeLog | 7 +++++++ gst/matroska/matroska-demux.c | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/ChangeLog b/ChangeLog index de09581faf..27da9e866a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-06-14 Tim-Philipp Müller + + * gst/matroska/matroska-demux.c: (gst_matroska_demux_add_stream): + No language specified means the implied language is English + according to the matroska spec (partially fixes #344708); + add some more debug output. + 2006-06-14 Tim-Philipp Müller * gst/wavparse/gstwavparse.c: (gst_wavparse_peek_chunk_info), diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index 34a44078d1..00eae2475b 100644 --- a/gst/matroska/matroska-demux.c +++ b/gst/matroska/matroska-demux.c @@ -690,6 +690,7 @@ gst_matroska_demux_add_stream (GstMatroskaDemux * demux) } context->codec_priv = data; context->codec_priv_size = size; + GST_LOG_OBJECT (demux, "%u bytes of codec private data", size); break; } @@ -714,6 +715,7 @@ gst_matroska_demux_add_stream (GstMatroskaDemux * demux) break; } context->name = text; + GST_LOG ("stream %d: trackname=%s", context->index, text); break; } @@ -725,7 +727,13 @@ gst_matroska_demux_add_stream (GstMatroskaDemux * demux) res = FALSE; break; } + context->language = text; + GST_LOG ("stream %d: language=%s", context->index, text); + + /* fre-ca => fre */ + if (strlen (context->language) >= 4 && context->language[3] == '-') + context->language[3] = '\0'; break; } @@ -889,6 +897,13 @@ gst_matroska_demux_add_stream (GstMatroskaDemux * demux) g_assert_not_reached (); } + if ((context->language == NULL || *context->language == '\0') && + (context->type == GST_MATROSKA_TRACK_TYPE_AUDIO || + context->type == GST_MATROSKA_TRACK_TYPE_SUBTITLE)) { + GST_LOG ("stream %d: language=eng (assuming default)", context->index); + context->language = g_strdup ("eng"); + } + if (context->language) { if (!list) list = gst_tag_list_new ();