From 7353cdc02960b207433a31489c91f618b15f725d Mon Sep 17 00:00:00 2001 From: Robin Stocker Date: Wed, 4 Feb 2009 09:20:28 +0100 Subject: [PATCH] Read Matroska Title element for the TITLE tag Not all Matroska files have a Tags element which contains information about the title among other things. Most video Matroska files only contain the Title element so we should parse this too. Fixes bug #570435. --- gst/matroska/matroska-demux.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index aafdd2adc7..3c656c2cdc 100644 --- a/gst/matroska/matroska-demux.c +++ b/gst/matroska/matroska-demux.c @@ -2743,6 +2743,21 @@ gst_matroska_demux_parse_info (GstMatroskaDemux * demux) break; } + case GST_MATROSKA_ID_TITLE:{ + gchar *text; + GstTagList *taglist; + + if ((ret = gst_ebml_read_utf8 (ebml, &id, &text)) != GST_FLOW_OK) + break; + + GST_DEBUG_OBJECT (demux, "Title: %s", GST_STR_NULL (text)); + taglist = gst_tag_list_new (); + gst_tag_list_add (taglist, GST_TAG_MERGE_APPEND, GST_TAG_TITLE, text, + NULL); + gst_element_found_tags (GST_ELEMENT (ebml), taglist); + break; + } + default: GST_WARNING_OBJECT (demux, "Unknown SegmentInfo subelement 0x%x - ignoring", id); @@ -2754,7 +2769,6 @@ gst_matroska_demux_parse_info (GstMatroskaDemux * demux) case GST_MATROSKA_ID_PREVFILENAME: case GST_MATROSKA_ID_NEXTUID: case GST_MATROSKA_ID_NEXTFILENAME: - case GST_MATROSKA_ID_TITLE: case GST_MATROSKA_ID_SEGMENTFAMILY: case GST_MATROSKA_ID_CHAPTERTRANSLATE: ret = gst_ebml_read_skip (ebml); -- 2.34.1