diff options
Diffstat (limited to 'stream/stream.c')
-rw-r--r-- | stream/stream.c | 38 |
1 files changed, 11 insertions, 27 deletions
diff --git a/stream/stream.c b/stream/stream.c index 7716e51a56..523fcc2e8e 100644 --- a/stream/stream.c +++ b/stream/stream.c @@ -60,18 +60,11 @@ static struct input_ctx *stream_check_interrupt_ctx; extern const stream_info_t stream_info_vcd; extern const stream_info_t stream_info_cdda; -extern const stream_info_t stream_info_asf; -extern const stream_info_t stream_info_udp; -extern const stream_info_t stream_info_http1; -extern const stream_info_t stream_info_http2; extern const stream_info_t stream_info_dvb; extern const stream_info_t stream_info_tv; extern const stream_info_t stream_info_radio; extern const stream_info_t stream_info_pvr; -extern const stream_info_t stream_info_ftp; -extern const stream_info_t stream_info_vstream; extern const stream_info_t stream_info_smb; - extern const stream_info_t stream_info_null; extern const stream_info_t stream_info_memory; extern const stream_info_t stream_info_mf; @@ -103,12 +96,6 @@ static const stream_info_t *const auto_open_streams[] = { #ifdef CONFIG_PVR &stream_info_pvr, #endif -#ifdef CONFIG_FTP - &stream_info_ftp, -#endif -#ifdef CONFIG_VSTREAM - &stream_info_vstream, -#endif #ifdef CONFIG_LIBSMBCLIENT &stream_info_smb, #endif @@ -169,11 +156,6 @@ static stream_t *open_stream_plugin(const stream_info_t *sinfo, if (!s->read_chunk) s->read_chunk = 4 * (s->sector_size ? s->sector_size : STREAM_BUFFER_SIZE); - if (s->streaming && !s->cache_size) { - // Set default cache size to use if user does not specify it. - s->cache_size = 320; - } - if (!s->seek) s->flags &= ~MP_STREAM_SEEK; if (s->seek && !(s->flags & MP_STREAM_SEEK)) @@ -622,16 +604,22 @@ stream_t *open_memory_stream(void *data, int len) return s; } +static int stream_enable_cache(stream_t **stream, int64_t size, int64_t min, + int64_t seek_limit); + +/** + * \return 1 on success, 0 if the function was interrupted and -1 on error, or + * if the cache is disabled + */ int stream_enable_cache_percent(stream_t **stream, int64_t stream_cache_size, + int64_t stream_cache_def_size, float stream_cache_min_percent, float stream_cache_seek_min_percent) { - if (stream_cache_size == -1) - stream_cache_size = (*stream)->cache_size; + stream_cache_size = (*stream)->streaming ? stream_cache_def_size : 0; stream_cache_size = stream_cache_size * 1024; // input is in KiB - return stream_enable_cache(stream, stream_cache_size, stream_cache_size * (stream_cache_min_percent / 100.0), @@ -639,12 +627,8 @@ int stream_enable_cache_percent(stream_t **stream, int64_t stream_cache_size, (stream_cache_seek_min_percent / 100.0)); } -/** - * \return 1 on success, 0 if the function was interrupted and -1 on error, or - * if the cache is disabled - */ -int stream_enable_cache(stream_t **stream, int64_t size, int64_t min, - int64_t seek_limit) +static int stream_enable_cache(stream_t **stream, int64_t size, int64_t min, + int64_t seek_limit) { stream_t *orig = *stream; |