summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-11-13 21:52:24 +0100
committerwm4 <wm4@nowhere>2012-11-14 00:46:15 +0100
commita2098326dac3587fb6f0869e515c07d1f9c762f8 (patch)
tree06973ec7e968460dc5ac37d31cd169b6e1e4175e /stream
parentdbb4a973d5b265130df178ca62c094ec7c45ce47 (diff)
downloadmpv-a2098326dac3587fb6f0869e515c07d1f9c762f8.tar.bz2
mpv-a2098326dac3587fb6f0869e515c07d1f9c762f8.tar.xz
network: fix crash with -playlist http://...
The function fixup_network_stream_cache() accesses stream->opts, which is NULL in some cases when loading playlists. stream->opts is a pointer to the global MPOpts struct. For simplicity, this parameter is left NULL in some cases. Usually, this doesn't matter, because barely anything in stream/ uses MPOpts anyway. Hack-fix this for now by not accessing MPOpts and disabling the stream cache in this case. Calling open_stream() with options==NULL now basically means: do not use cache settings.
Diffstat (limited to 'stream')
-rw-r--r--stream/network.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/stream/network.c b/stream/network.c
index f80017e75b..c324017d48 100644
--- a/stream/network.c
+++ b/stream/network.c
@@ -457,6 +457,8 @@ nop_streaming_seek( int fd, off_t pos, streaming_ctrl_t *stream_ctrl ) {
void fixup_network_stream_cache(stream_t *stream) {
struct MPOpts *opts = stream->opts;
+ if(!opts)
+ return;
if(stream->streaming_ctrl->buffering) {
if(opts->stream_cache_size<0) {
// cache option not set, will use our computed value.