diff options
author | wm4 <wm4@nowhere> | 2013-08-25 22:58:29 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-08-26 10:09:46 +0200 |
commit | 3fc3bf70f972f4e68258193f0f9c70ee6b85be5e (patch) | |
tree | 7c953cee512669da24d83c1b6ffefce74f3ddc53 /demux | |
parent | 74b846e2f7d95e4dea2fdae4b1301a2c83f2acd3 (diff) | |
download | mpv-3fc3bf70f972f4e68258193f0f9c70ee6b85be5e.tar.bz2 mpv-3fc3bf70f972f4e68258193f0f9c70ee6b85be5e.tar.xz |
stream: add uncompressed rar support
Apparently, it is popular to store large files in uncompressed rar
archives. Extracting files is not practical, and some media players
suport playing directly from uncompressed rar (at least VLC and some
DirectShow components).
Storing or accessing files this way is completely idiotic, but it is
a common practice, and the ones subjected to this practice can't do
much to change this (at least that's what I assume/hope). Also, it's
a feature request, so we say yes.
This code is mostly taken from VLC (commit f6e7240 from their git tree).
We also copy the way this is done: opening a rar file by itself yields
a playlist, which contains URLs to the actual entries in the rar file.
Compressed entries are simply skipped.
Diffstat (limited to 'demux')
-rw-r--r-- | demux/demux.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/demux/demux.c b/demux/demux.c index 404050a420..f8653b4411 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -604,6 +604,10 @@ struct demuxer *demux_open(struct stream *stream, char *force_format, } } + // Peek this much data to avoid that stream_read() run by some demuxers + // or stream filters will flush previous peeked data. + stream_peek(stream, STREAM_BUFFER_SIZE); + // Test demuxers from first to last, one pass for each check_levels[] entry for (int pass = 0; check_levels[pass] != -1; pass++) { enum demux_check level = check_levels[pass]; |