changeset 3675:736c7c66234a libavformat

matroskadec: don't care about the number of bytes read by ebml_read_element_id()
author aurel
date Tue, 05 Aug 2008 00:42:10 +0000
parents a335cbe1fc1c
children d2ff1b7ad060
files matroskadec.c
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/matroskadec.c	Tue Aug 05 00:42:08 2008 +0000
+++ b/matroskadec.c	Tue Aug 05 00:42:10 2008 +0000
@@ -527,7 +527,7 @@
 
 /*
  * Read: the element content data ID.
- * Return: the number of bytes read or < 0 on error.
+ * 0 is success, < 0 is failure.
  */
 static int ebml_read_element_id(MatroskaDemuxContext *matroska, uint32_t *id)
 {
@@ -545,7 +545,7 @@
         return read;
     *id = matroska->peek_id  = total | (1 << (read * 7));
 
-    return read;
+    return 0;
 }
 
 /*
@@ -908,7 +908,7 @@
 static int ebml_parse(MatroskaDemuxContext *matroska, EbmlSyntax *syntax,
                       void *data, int once)
 {
-    int i, res = 0, res2;
+    int i, res = 0;
     uint32_t id = 0;
 
     for (i=0; syntax[i].id; i++)
@@ -926,9 +926,8 @@
         }
 
     while (!res && !ebml_level_end(matroska)) {
-        res2 = ebml_read_element_id(matroska, &id);
-        if (res2 < 0)
-            break;
+        res = ebml_read_element_id(matroska, &id);
+        if (!res)
         res = ebml_parse_id(matroska, syntax, id, data);
         if (once)
             break;