mirror of
https://github.com/mpv-player/mpv
synced 2025-01-05 03:06:28 +01:00
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.
This commit is contained in:
parent
dbb4a973d5
commit
a2098326da
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user