mirror of https://github.com/mpv-player/mpv
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:
parent
4e11ac82aa
commit
e64645540a
|
@ -116,6 +116,7 @@ static void associate_streams(struct demuxer *demuxer,
|
||||||
for (int n = 0; n < num_streams; n++) {
|
for (int n = 0; n < num_streams; n++) {
|
||||||
struct sh_stream *sh = demux_get_stream(seg->d, n);
|
struct sh_stream *sh = demux_get_stream(seg->d, n);
|
||||||
struct virtual_stream *other = NULL;
|
struct virtual_stream *other = NULL;
|
||||||
|
|
||||||
for (int i = 0; i < src->num_streams; i++) {
|
for (int i = 0; i < src->num_streams; i++) {
|
||||||
struct virtual_stream *vs = src->streams[i];
|
struct virtual_stream *vs = src->streams[i];
|
||||||
|
|
||||||
|
@ -134,6 +135,11 @@ static void associate_streams(struct demuxer *demuxer,
|
||||||
other = vs;
|
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);
|
MP_TARRAY_APPEND(seg, seg->stream_map, seg->num_stream_map, other);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue