aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/matroska.c
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2007-03-11 22:26:39 +0000
committerAurelien Jacobs <aurel@gnuage.org>2007-03-11 22:26:39 +0000
commit0fb7a2b9bf6b4e06e3864dbe68eefb7bef68df32 (patch)
tree3421cbaea59b0c41b6e176bf8224e2a2d98a8302 /libavformat/matroska.c
parent0f3bd8ce1bc313520631abd109b54e8d68b5129e (diff)
downloadffmpeg-0fb7a2b9bf6b4e06e3864dbe68eefb7bef68df32.tar.gz
parse clusters until some packets are queued
instead of parsing only one cluster Originally committed as revision 8329 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/matroska.c')
-rw-r--r--libavformat/matroska.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/libavformat/matroska.c b/libavformat/matroska.c
index c8148c6a86..32572c7861 100644
--- a/libavformat/matroska.c
+++ b/libavformat/matroska.c
@@ -2698,9 +2698,8 @@ matroska_read_packet (AVFormatContext *s,
int res = 0;
uint32_t id;
- /* Do we still have a packet queued? */
- if (matroska_deliver_packet(matroska, pkt) == 0)
- return 0;
+ /* Read stream until we have a packet queued. */
+ while (matroska_deliver_packet(matroska, pkt)) {
/* Have we already reached the end? */
if (matroska->done)
@@ -2708,8 +2707,7 @@ matroska_read_packet (AVFormatContext *s,
while (res == 0) {
if (!(id = ebml_peek_id(matroska, &matroska->level_up))) {
- res = AVERROR_IO;
- break;
+ return AVERROR_IO;
} else if (matroska->level_up) {
matroska->level_up--;
break;
@@ -2737,8 +2735,9 @@ matroska_read_packet (AVFormatContext *s,
if (res == -1)
matroska->done = 1;
+ }
- return matroska_deliver_packet(matroska, pkt);
+ return 0;
}
static int