From d7ca95c3ea90782c786a6a607d3713bb42a104b1 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 19 May 2018 12:08:48 +0200 Subject: command: whitelist some blocking accesses for certain demuxers/streams The properties/commands touched in this commit are all for obscure special inputs (BD/DVD/DVB/TV), and they all block on the demuxer/stream layer. For network streams, this blocking is very unwelcome. They will affect playback and probably introduce pauses and frame drops. The player can even freeze fully, and the logic that tries to make playback abortable even if frozen complicates the player. Since the mentioned accesses are not needed for network streams, but they will block on network streams even though they're going to fail, add a flag that coarsely enables/disables these accesses. Essentially it establishes a whitelist of demuxers/streams which support them. In theory you could to access BD/DVD images over network (or add such support, I don't think it's a thing in mpv). In these cases these controls still can block and could even "freeze" the player completely. Writing to the "program" and "cache-size" properties still can block even for network streams. Just don't use them if you don't want freezes. --- stream/stream.h | 1 + stream/stream_dvb.c | 1 + 2 files changed, 2 insertions(+) (limited to 'stream') diff --git a/stream/stream.h b/stream/stream.h index 863c0cfd3c..2f59e5318f 100644 --- a/stream/stream.h +++ b/stream/stream.h @@ -184,6 +184,7 @@ typedef struct stream { bool is_local_file : 1; // from the filesystem bool is_directory : 1; // directory on the filesystem bool access_references : 1; // open other streams + bool extended_ctrls : 1; // supports some of BD/DVD/DVB/TV controls struct mp_log *log; struct mpv_global *global; diff --git a/stream/stream_dvb.c b/stream/stream_dvb.c index 02c5878ca9..9821119cac 100644 --- a/stream/stream_dvb.c +++ b/stream/stream_dvb.c @@ -1120,6 +1120,7 @@ static int dvb_open(stream_t *stream) stream->allow_caching = true; stream->demuxer = "lavf"; stream->lavf_type = "mpegts"; + stream->extended_ctrls = true; return STREAM_OK; -- cgit v1.2.3