summaryrefslogtreecommitdiffstats
path: root/gst/matroska/ebml-read.c
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2008-06-15 09:43:25 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2008-06-15 09:43:25 +0000
commit3a99102c491970acefceeed80b74d1b973807b4f (patch)
treebe551e2f22ffc01713477eae39fd2f3f21957d23 /gst/matroska/ebml-read.c
parent1051e57b36ab07667e38c2ba5c98357a80991114 (diff)
gst/matroska/: Handle EBML elements like Void or CRC32 in the EbmlRead base class already. They're not useful in the ...
Original commit message from CVS: * gst/matroska/ebml-read.c: (gst_ebml_peek_id), (gst_ebml_read_header): * gst/matroska/matroska-demux.c: (gst_matroska_demux_add_stream), (gst_matroska_demux_parse_tracks), (gst_matroska_demux_parse_index_cuetrack), (gst_matroska_demux_parse_index_pointentry), (gst_matroska_demux_parse_index), (gst_matroska_demux_parse_info), (gst_matroska_demux_parse_metadata_id_simple_tag), (gst_matroska_demux_parse_metadata_id_tag), (gst_matroska_demux_parse_metadata), (gst_matroska_demux_parse_attachments), (gst_matroska_demux_parse_chapters), (gst_matroska_demux_parse_blockgroup_or_simpleblock), (gst_matroska_demux_parse_cluster), (gst_matroska_demux_parse_contents_seekentry), (gst_matroska_demux_parse_contents), (gst_matroska_demux_loop_stream_parse_id): Handle EBML elements like Void or CRC32 in the EbmlRead base class already. They're not useful in the matroska parser and only cause additional code.
Diffstat (limited to 'gst/matroska/ebml-read.c')
-rw-r--r--gst/matroska/ebml-read.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/gst/matroska/ebml-read.c b/gst/matroska/ebml-read.c
index 45dd3b3f..fce3ff61 100644
--- a/gst/matroska/ebml-read.c
+++ b/gst/matroska/ebml-read.c
@@ -432,16 +432,41 @@ gst_ebml_peek_id (GstEbmlRead * ebml, guint * level_up, guint32 * id)
{
guint64 off;
+ guint level_up_tmp = 0;
+
GstFlowReturn ret;
g_assert (level_up);
+ g_assert (id);
+
+ *level_up = 0;
+next:
off = ebml->offset; /* save offset */
- if ((ret = gst_ebml_read_element_id (ebml, id, level_up)) != GST_FLOW_OK)
+ if ((ret = gst_ebml_read_element_id (ebml, id, &level_up_tmp)) != GST_FLOW_OK)
return ret;
ebml->offset = off; /* restore offset */
+
+ *level_up += level_up_tmp;
+ level_up_tmp = 0;
+
+ switch (*id) {
+ case GST_EBML_ID_VOID:
+ GST_DEBUG_OBJECT (ebml, "Skipping EBML Void element");
+ if ((ret = gst_ebml_read_skip (ebml)) != GST_FLOW_OK)
+ return ret;
+ goto next;
+ break;
+ case GST_EBML_ID_CRC32:
+ GST_DEBUG_OBJECT (ebml, "Skipping EBML CRC32 element");
+ if ((ret = gst_ebml_read_skip (ebml)) != GST_FLOW_OK)
+ return ret;
+ goto next;
+ break;
+ }
+
return ret;
}
@@ -990,7 +1015,6 @@ gst_ebml_read_header (GstEbmlRead * ebml, gchar ** doctype, guint * version)
/* pass-through */
/* we ignore these two, as they don't tell us anything we care about */
- case GST_EBML_ID_VOID:
case GST_EBML_ID_EBMLVERSION:
case GST_EBML_ID_DOCTYPEVERSION:
ret = gst_ebml_read_skip (ebml);