summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-02-20 12:16:32 +0100
committerwm4 <wm4@nowhere>2020-02-20 12:16:32 +0100
commite64645540a8f5bee60d88d377e962e3641d30a5c (patch)
tree4bb7a1058ae27d8c5b52ee1e30e8cb4ee07d28eb
parent4e11ac82aa9116bbf02dffc0b639d5b5f0f0ef35 (diff)
downloadmpv-e64645540a8f5bee60d88d377e962e3641d30a5c.tar.bz2
mpv-e64645540a8f5bee60d88d377e962e3641d30a5c.tar.xz
demux_timeline: warn if streams are invisible
ytdl_hook.lua can do this with all_formats and when delay_open is used, and if the source stream actually contains both audio and video. In this case, it might accidentally hide a media type completely, or waste bandwidth (if the stream has true interleaved audio/video). So it's important to warn.
-rw-r--r--demux/demux_timeline.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/demux/demux_timeline.c b/demux/demux_timeline.c
index a9a762d3e4..78bbf87fa2 100644
--- a/demux/demux_timeline.c
+++ b/demux/demux_timeline.c
@@ -116,6 +116,7 @@ static void associate_streams(struct demuxer *demuxer,
for (int n = 0; n < num_streams; n++) {
struct sh_stream *sh = demux_get_stream(seg->d, n);
struct virtual_stream *other = NULL;
+
for (int i = 0; i < src->num_streams; i++) {
struct virtual_stream *vs = src->streams[i];
@@ -134,6 +135,11 @@ static void associate_streams(struct demuxer *demuxer,
other = vs;
}
+ if (!other) {
+ MP_WARN(demuxer, "Source stream %d (%s) unused and hidden.\n",
+ n, stream_type_name(sh->type));
+ }
+
MP_TARRAY_APPEND(seg, seg->stream_map, seg->num_stream_map, other);
}
}