summaryrefslogtreecommitdiffstats
path: root/demux/demux_cue.c
diff options
context:
space:
mode:
Diffstat (limited to 'demux/demux_cue.c')
-rw-r--r--demux/demux_cue.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/demux/demux_cue.c b/demux/demux_cue.c
index 2f2e6fca46..bc1b727f5f 100644
--- a/demux/demux_cue.c
+++ b/demux/demux_cue.c
@@ -35,13 +35,9 @@ static int try_open_file(struct demuxer *demuxer, enum demux_check check)
{
struct stream *s = demuxer->stream;
if (check >= DEMUX_CHECK_UNSAFE) {
- char buf[PROBE_SIZE];
- int len = stream_read(s, buf, sizeof(buf));
- if (len <= 0)
+ bstr d = stream_peek(s, PROBE_SIZE);
+ if (d.len < 1 || !mp_probe_cue(d))
return -1;
- if (!mp_probe_cue((struct bstr) { buf, len }))
- return -1;
- stream_seek(s, 0);
}
demuxer->file_contents = stream_read_complete(s, demuxer, 1000000);
if (demuxer->file_contents.start == NULL)