summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-12-04 23:15:31 +0100
committerwm4 <wm4@nowhere>2016-12-04 23:15:31 +0100
commitceb2e1026d4295d3831d080dc18f8ca5db56bc5c (patch)
treeff0bc73ad982c1a1740aa8b1fb31b83fabbe7879 /stream
parent83c5f704e7d483e2db6df90dacd24896d45fe39a (diff)
downloadmpv-ceb2e1026d4295d3831d080dc18f8ca5db56bc5c.tar.bz2
mpv-ceb2e1026d4295d3831d080dc18f8ca5db56bc5c.tar.xz
demux, stream: add option to prevent opening referenced files
Quite irresponsibly hacked together. Sue me.
Diffstat (limited to 'stream')
-rw-r--r--stream/stream.c6
-rw-r--r--stream/stream.h1
-rw-r--r--stream/stream_bluray.c3
-rw-r--r--stream/stream_dvd.c3
-rw-r--r--stream/stream_dvdnav.c3
5 files changed, 16 insertions, 0 deletions
diff --git a/stream/stream.c b/stream/stream.c
index c936c5c77e..4c7aa04844 100644
--- a/stream/stream.c
+++ b/stream/stream.c
@@ -230,6 +230,12 @@ static int open_internal(const stream_info_t *sinfo, const char *url, int flags,
s->is_network = sinfo->is_network;
s->mode = flags & (STREAM_READ | STREAM_WRITE);
+ if (global->config) {
+ int opt;
+ mp_read_option_raw(global, "access-references", &m_option_type_flag, &opt);
+ s->access_references = opt;
+ }
+
MP_VERBOSE(s, "Opening %s\n", url);
if ((s->mode & STREAM_WRITE) && !sinfo->can_write) {
diff --git a/stream/stream.h b/stream/stream.h
index 4444da8ed3..7d44e30eae 100644
--- a/stream/stream.h
+++ b/stream/stream.h
@@ -197,6 +197,7 @@ typedef struct stream {
bool fast_skip : 1; // consider stream fast enough to fw-seek by skipping
bool is_network : 1; // original stream_info_t.is_network flag
bool allow_caching : 1; // stream cache makes sense
+ bool access_references : 1; // open other streams
struct mp_log *log;
struct mpv_global *global;
diff --git a/stream/stream_bluray.c b/stream/stream_bluray.c
index 26a78e5f21..5f083954c2 100644
--- a/stream/stream_bluray.c
+++ b/stream/stream_bluray.c
@@ -569,6 +569,9 @@ static int bdmv_dir_stream_open(stream_t *stream)
.cfg_title = BLURAY_DEFAULT_TITLE,
};
+ if (!stream->access_references)
+ goto unsupported;
+
char *path = mp_file_get_path(priv, bstr0(stream->url));
if (!path)
goto unsupported;
diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c
index 4b423de630..338c23633c 100644
--- a/stream/stream_dvd.c
+++ b/stream/stream_dvd.c
@@ -951,6 +951,9 @@ static int ifo_stream_open(stream_t *stream)
dvd_priv_t *priv = talloc_zero(stream, dvd_priv_t);
stream->priv = priv;
+ if (!stream->access_references)
+ goto unsupported;
+
char *path = mp_file_get_path(priv, bstr0(stream->url));
if (!path)
goto unsupported;
diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c
index ec15c83b20..1178f50857 100644
--- a/stream/stream_dvdnav.c
+++ b/stream/stream_dvdnav.c
@@ -562,6 +562,9 @@ static int ifo_dvdnav_stream_open(stream_t *stream)
struct priv *priv = talloc_zero(stream, struct priv);
stream->priv = priv;
+ if (!stream->access_references)
+ goto unsupported;
+
priv->track = TITLE_LONGEST;
char *path = mp_file_get_path(priv, bstr0(stream->url));