gst/matroska/matroska-demux.c: No language specified means the implied language is...
authorTim-Philipp Müller <tim@centricular.net>
Wed, 14 Jun 2006 11:28:41 +0000 (11:28 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Wed, 14 Jun 2006 11:28:41 +0000 (11:28 +0000)
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
gst/matroska/matroska-demux.c

index de09581..27da9e8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2006-06-14  Tim-Philipp Müller  <tim at centricular dot net>
 
+       * 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  <tim at centricular dot net>
+
        * gst/wavparse/gstwavparse.c: (gst_wavparse_peek_chunk_info),
        (gst_wavparse_peek_chunk), (gst_wavparse_stream_headers),
        (gst_wavparse_chain):
index 34a4407..00eae24 100644 (file)
@@ -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 ();