changeset 1490:1bf0132b9dff libavformat

Allows playback of truncated matroska files.
author aurel
date Sun, 12 Nov 2006 16:59:27 +0000
parents 40290ec3d034
children 89f88d324eea
files matroska.c
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/matroska.c	Sun Nov 12 16:36:14 2006 +0000
+++ b/matroska.c	Sun Nov 12 16:59:27 2006 +0000
@@ -1942,7 +1942,7 @@
                         /* check ID */
                         if (!(id = ebml_peek_id (matroska,
                                                  &matroska->level_up)))
-                            break;
+                            goto finish;
                         if (id != seek_id) {
                             av_log(matroska->ctx, AV_LOG_INFO,
                                    "We looked for ID=0x%x but got "
@@ -1954,7 +1954,7 @@
 
                         /* read master + parse */
                         if ((res = ebml_read_master(matroska, &id)) < 0)
-                            break;
+                            goto finish;
                         switch (id) {
                             case MATROSKA_ID_CUES:
                                 if (!(res = matroska_parse_index(matroska)) ||
@@ -1971,8 +1971,6 @@
                                 }
                                 break;
                         }
-                        if (res < 0)
-                            break;
 
                     finish:
                         /* remove dummy level */