demux_mkv: don't print non-sense warning on normal EOF

Commit ac1c5e6 (demux_mkv: improve robustness against broken files)
added code to skip to the next cluster on error conditions. However,
reaching normal EOF triggers this code as well, so explicitly check
for EOF before this happens. Note that the EOF flag is only set _after_
reading the last byte, so EOF needs to be checked after the fact. (Or
in other words, we must check for EOF after the ebml_read_id() call.)

(To answer the question why reading packets actually reaches EOF, even
if there's the seek index between the last packet and the end of the
file: the cluster reading code skips the seeking related EBML elements
as normal part of operation, so it hits EOF gracefully when trying to
find the next cluster.)
This commit is contained in:
wm4 2013-03-30 20:43:06 +01:00
parent e31567fe41
commit 0142985228
1 changed files with 1 additions and 1 deletions

View File

@ -2310,9 +2310,9 @@ static int demux_mkv_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds)
uint32_t id = ebml_read_id(s, &il);
if (id == MATROSKA_ID_CLUSTER)
break;
ebml_read_skip_or_resync_cluster(s, NULL);
if (s->eof)
return 0;
ebml_read_skip_or_resync_cluster(s, NULL);
}
mkv_d->cluster_start = stream_tell(s) - il;
mkv_d->cluster_size = ebml_read_length(s, NULL);