summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-03-09 22:33:53 +0100
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-03-11 12:49:40 +0900
commit2b737f8bfcd9cd9a555d15296bcd753e53e893d0 (patch)
tree0eeaec30a1a5d2d863c2c9303e313f3a19ef9787
parent9e99a0c8b95980fc5ff7879c6a1b7e6de479b7dc (diff)
downloadmpv-2b737f8bfcd9cd9a555d15296bcd753e53e893d0.tar.bz2
mpv-2b737f8bfcd9cd9a555d15296bcd753e53e893d0.tar.xz
demux_mkv: never warn when trying to resync on EOF
If this happens, the file is actually broken, but the assumption is simply that the file was truncated, and printing a warning would be strange. (cherry picked from commit 112d9aeda1f059f22cd4cf0cbb2f489a74ecd9eb)
-rw-r--r--demux/ebml.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/demux/ebml.c b/demux/ebml.c
index 99d8970174..52e0f75888 100644
--- a/demux/ebml.c
+++ b/demux/ebml.c
@@ -228,8 +228,10 @@ int ebml_resync_cluster(struct mp_log *log, stream_t *s)
{
int64_t pos = stream_tell(s);
uint32_t last_4_bytes = 0;
- mp_err(log, "Corrupt file detected. "
- "Trying to resync starting from position %"PRId64"...\n", pos);
+ if (!s->eof) {
+ mp_err(log, "Corrupt file detected. "
+ "Trying to resync starting from position %"PRId64"...\n", pos);
+ }
while (!s->eof) {
// Assumes MATROSKA_ID_CLUSTER is 4 bytes, with no 0 bytes.
if (last_4_bytes == MATROSKA_ID_CLUSTER) {