summaryrefslogtreecommitdiffstats
path: root/demux/demux.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-09-08 15:50:29 +0200
committerwm4 <wm4@nowhere>2019-09-19 20:37:04 +0200
commitcfa5c73cb575ba584a14d1a6318600a677b59da8 (patch)
tree84505b56bf1191865eca4906e290009c103d1680 /demux/demux.c
parent18180ae89b7d162e04d84d36fa04ac14a58db1f7 (diff)
downloadmpv-cfa5c73cb575ba584a14d1a6318600a677b59da8.tar.bz2
mpv-cfa5c73cb575ba584a14d1a6318600a677b59da8.tar.xz
demux: remove some more minor dead code
Also add clarifications.
Diffstat (limited to 'demux/demux.c')
-rw-r--r--demux/demux.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/demux/demux.c b/demux/demux.c
index cac4874e8b..94f9aec856 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -2421,6 +2421,10 @@ static struct demuxer *open_given_type(struct mpv_global *global,
}
}
}
+ // Let this demuxer free demuxer->stream. Timeline sub-demuxers can
+ // share a stream, and in these cases the demux_timeline instance
+ // should own the stream, as it frees the sub demuxers first.
+ demuxer->in->owns_stream = true;
return demuxer;
}
@@ -2433,9 +2437,6 @@ static const int d_request[] = {DEMUX_CHECK_REQUEST, -1};
static const int d_force[] = {DEMUX_CHECK_FORCE, -1};
// params can be NULL
-// If params->does_not_own_stream==false, this does _not_ free the stream if
-// opening fails. But if it succeeds, a later demux_free() call will free the
-// stream.
// This may free the stream parameter on success.
static struct demuxer *demux_open(struct stream *stream,
struct demuxer_params *params,
@@ -2477,8 +2478,6 @@ static struct demuxer *demux_open(struct stream *stream,
if (demuxer) {
talloc_steal(demuxer, log);
log = NULL;
- demuxer->in->owns_stream =
- params ? !params->does_not_own_stream : true;
goto done;
}
}
@@ -2504,7 +2503,6 @@ struct demuxer *demux_open_url(const char *url,
struct demuxer_params dummy = {0};
if (!params)
params = &dummy;
- assert(!params->does_not_own_stream); // API user error
struct mp_cancel *priv_cancel = mp_cancel_new(NULL);
if (cancel)
mp_cancel_set_parent(priv_cancel, cancel);