changeset 3690:50c074bc02b4 libavformat

matroskadec: expand useless ebml_read_element_id() wrapper
author aurel
date Tue, 05 Aug 2008 00:42:58 +0000
parents bce0dc931087
children b91cad3c97e8
files matroskadec.c
diffstat 1 files changed, 3 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/matroskadec.c	Tue Aug 05 00:42:55 2008 +0000
+++ b/matroskadec.c	Tue Aug 05 00:42:58 2008 +0000
@@ -522,23 +522,6 @@
 }
 
 /*
- * Read: the element content data ID.
- * 0 is success, < 0 is failure.
- */
-static int ebml_read_element_id(MatroskaDemuxContext *matroska, uint32_t *id)
-{
-    int read;
-    uint64_t total;
-
-    /* read out the "EBML number", include tag in ID */
-    if ((read = ebml_read_num(matroska, matroska->ctx->pb, 4, &total)) < 0)
-        return read;
-    *id = total | (1 << (read * 7));
-
-    return 0;
-}
-
-/*
  * Read the next element as an unsigned int.
  * 0 is success, < 0 is failure.
  */
@@ -683,8 +666,9 @@
 static int ebml_parse(MatroskaDemuxContext *matroska, EbmlSyntax *syntax,
                       void *data)
 {
-    uint32_t id;
-    int res = ebml_read_element_id(matroska, &id);
+    uint64_t id;
+    int res = ebml_read_num(matroska, matroska->ctx->pb, 4, &id);
+    id |= 1 << 7*res;
     return res < 0 ? res : ebml_parse_id(matroska, syntax, id, data);
 }