From e64645540a8f5bee60d88d377e962e3641d30a5c Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 20 Feb 2020 12:16:32 +0100 Subject: 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. --- demux/demux_timeline.c | 6 ++++++ 1 file changed, 6 insertions(+) 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); } } -- cgit v1.2.3