From f989b6081b38d4b05e38ec879e0364694eb08152 Mon Sep 17 00:00:00 2001
From: wm4 <wm4@nowhere>
Date: Sun, 14 Apr 2013 02:39:11 +0200
Subject: [PATCH] demux_mkv: don't terminate if there are no clusters

Matroska segment linking allows abusing Matroska files as playlists
without any actual video/audio/sub data, making files without any
clusters still useful for the frontend.
---
 demux/demux_mkv.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c
index addc8dcdcb..00f5a1a722 100644
--- a/demux/demux_mkv.c
+++ b/demux/demux_mkv.c
@@ -1716,8 +1716,9 @@ static int demux_mkv_open(demuxer_t *demuxer)
     while (1) {
         uint32_t id = ebml_read_id(s, NULL);
         if (s->eof) {
-            mp_tmsg(MSGT_DEMUX, MSGL_ERR, "[mkv] Unexpected end of file\n");
-            return 0;
+            mp_tmsg(MSGT_DEMUX, MSGL_WARN,
+                    "[mkv] Unexpected end of file (no clusters found)\n");
+            break;
         }
         if (id == MATROSKA_ID_CLUSTER) {
             mp_msg(MSGT_DEMUX, MSGL_V, "[mkv] |+ found cluster, headers are "