diff options
author | wm4 <wm4@nowhere> | 2017-02-02 18:38:16 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-02-02 18:38:16 +0100 |
commit | 95d4c2d7f61155633e89c18e740e7cf743a655d6 (patch) | |
tree | 89cb0fe2797eee4e54dfb693e485e4897682b950 /demux | |
parent | fb9a32977d6abf4c83a92d993af58e393819c062 (diff) | |
download | mpv-95d4c2d7f61155633e89c18e740e7cf743a655d6.tar.bz2 mpv-95d4c2d7f61155633e89c18e740e7cf743a655d6.tar.xz |
player: different way to auto-enable the demuxer cache
Instead of enabling it only when a stream-cache is enabled, also try to
enable it independently from that if the demuxer is marked as
is_network.
Also add some code to the EDL code, so EDLs containing network streams
are automatically cached this way.
Extend the OSD info line so that it shows the demuxer cache in this case
(more or less).
I didn't find where or whether options.rst describes how the demuxer
cache is enabled, so no changes there.
Diffstat (limited to 'demux')
-rw-r--r-- | demux/demux.c | 13 | ||||
-rw-r--r-- | demux/demux_edl.c | 2 | ||||
-rw-r--r-- | demux/demux_timeline.c | 2 |
3 files changed, 11 insertions, 6 deletions
diff --git a/demux/demux.c b/demux/demux.c index 5e43a38d81..d21b20910a 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -1263,9 +1263,6 @@ static struct demuxer *open_given_type(struct mpv_global *global, pthread_mutex_init(&in->lock, NULL); pthread_cond_init(&in->wakeup, NULL); - if (stream->caching) - in->min_secs = MPMAX(in->min_secs, opts->min_secs_cache); - *in->d_thread = *demuxer; *in->d_buffer = *demuxer; @@ -1314,11 +1311,15 @@ static struct demuxer *open_given_type(struct mpv_global *global, struct demuxer *sub = open_given_type(global, log, &demuxer_desc_timeline, stream, ¶ms2, DEMUX_CHECK_FORCE); - if (sub) - return sub; - timeline_destroy(tl); + if (sub) { + demuxer = sub; + } else { + timeline_destroy(tl); + } } } + if (demuxer->is_network || stream->caching) + in->min_secs = MPMAX(in->min_secs, opts->min_secs_cache); return demuxer; } diff --git a/demux/demux_edl.c b/demux/demux_edl.c index 240c224ab7..65a18a1a41 100644 --- a/demux/demux_edl.c +++ b/demux/demux_edl.c @@ -254,6 +254,8 @@ static void build_timeline(struct timeline *tl, struct tl_parts *parts) }; starttime += part->length; + + tl->demuxer->is_network |= source->is_network; } tl->parts[parts->num_parts] = (struct timeline_part) {.start = starttime}; tl->num_parts = parts->num_parts; diff --git a/demux/demux_timeline.c b/demux/demux_timeline.c index 8784dcf8f6..afd7eb5247 100644 --- a/demux/demux_timeline.c +++ b/demux/demux_timeline.c @@ -352,6 +352,8 @@ static int d_open(struct demuxer *demuxer, enum demux_check check) demuxer->filetype = meta->filetype ? meta->filetype : meta->desc->name; + demuxer->is_network = p->tl->demuxer->is_network; + reselect_streams(demuxer); return 0; |