demux_mkv: don't stop playback on non-Cluster elements

The main demuxing code signaled EOF and stopped playback if it hit a
top-level element other than Cluster. There are files with other
elements between Cluster ones, at least repeated copies of Track
headers. Change the code to skip any non-Cluster element and only stop
searching on real file EOF.
This commit is contained in:
Uoti Urpala 2010-01-25 13:27:35 +02:00
parent d8a6af2980
commit 298808cddc
1 changed files with 5 additions and 2 deletions

View File

@ -2771,8 +2771,11 @@ static int demux_mkv_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds)
}
}
if (ebml_read_id(s, &il) != MATROSKA_ID_CLUSTER)
return 0;
while (ebml_read_id(s, &il) != MATROSKA_ID_CLUSTER) {
ebml_read_skip(s, NULL);
if (s->eof)
return 0;
}
mkv_d->cluster_start = stream_tell(s) - il;
mkv_d->cluster_size = ebml_read_length(s, NULL);
}