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.
This commit is contained in:
wm4 2020-02-20 12:16:32 +01:00
parent 4e11ac82aa
commit e64645540a
1 changed files with 6 additions and 0 deletions

View File

@ -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);
}
}