Commit 0fb7a2b9 authored by Aurelien Jacobs's avatar Aurelien Jacobs

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
parent 0f3bd8ce
...@@ -2698,9 +2698,8 @@ matroska_read_packet (AVFormatContext *s, ...@@ -2698,9 +2698,8 @@ matroska_read_packet (AVFormatContext *s,
int res = 0; int res = 0;
uint32_t id; uint32_t id;
/* Do we still have a packet queued? */ /* Read stream until we have a packet queued. */
if (matroska_deliver_packet(matroska, pkt) == 0) while (matroska_deliver_packet(matroska, pkt)) {
return 0;
/* Have we already reached the end? */ /* Have we already reached the end? */
if (matroska->done) if (matroska->done)
...@@ -2708,8 +2707,7 @@ matroska_read_packet (AVFormatContext *s, ...@@ -2708,8 +2707,7 @@ matroska_read_packet (AVFormatContext *s,
while (res == 0) { while (res == 0) {
if (!(id = ebml_peek_id(matroska, &matroska->level_up))) { if (!(id = ebml_peek_id(matroska, &matroska->level_up))) {
res = AVERROR_IO; return AVERROR_IO;
break;
} else if (matroska->level_up) { } else if (matroska->level_up) {
matroska->level_up--; matroska->level_up--;
break; break;
...@@ -2737,8 +2735,9 @@ matroska_read_packet (AVFormatContext *s, ...@@ -2737,8 +2735,9 @@ matroska_read_packet (AVFormatContext *s,
if (res == -1) if (res == -1)
matroska->done = 1; matroska->done = 1;
}
return matroska_deliver_packet(matroska, pkt); return 0;
} }
static int static int
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment