Skip empty clusters without thinking it's the end of the file.

This commit is contained in:
Moritz Bunkus 2004-09-02 18:35:36 +00:00
parent 1435f84a8b
commit ac54a6cd30
2 changed files with 9 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2004-09-02 Moritz Bunkus <moritz@bunkus.org>
* mkvmerge: bug fix: Empty clusters in Matroska files no longer
make mkvmerge think that file has been read completely.
2004-08-31 Moritz Bunkus <moritz@bunkus.org>
* mkvmerge: new feature: Added support for MP2 (and maybe MP3)

View File

@ -1747,7 +1747,7 @@ kax_reader_c::read(generic_packetizer_c *,
KaxClusterTimecode *ctc;
int64_t block_fref, block_bref, block_duration, frame_duration;
kax_track_t *block_track;
bool found_data, bref_found, fref_found;
bool found_cluster, bref_found, fref_found;
if (tracks.size() == 0)
return 0;
@ -1762,7 +1762,7 @@ kax_reader_c::read(generic_packetizer_c *,
debug_enter("kax_reader_c::read");
found_data = false;
found_cluster = false;
upper_lvl_el = 0;
l1 = saved_l1;
saved_l1 = NULL;
@ -1771,6 +1771,7 @@ kax_reader_c::read(generic_packetizer_c *,
while ((l1 != NULL) && (upper_lvl_el <= 0)) {
if (EbmlId(*l1) == KaxCluster::ClassInfos.GlobalId) {
found_cluster = true;
cluster = (KaxCluster *)l1;
cluster->Read(*es, KaxCluster::ClassInfos.Context, upper_lvl_el, l2,
true);
@ -1914,7 +1915,6 @@ kax_reader_c::read(generic_packetizer_c *,
block_track->units_processed += block->NumberFrames();
}
found_data = true;
}
}
@ -1955,7 +1955,7 @@ kax_reader_c::read(generic_packetizer_c *,
debug_leave("kax_reader_c::read");
if (found_data)
if (found_cluster)
return EMOREDATA;
else {
flush_packetizers();