demux: stop iterating over demuxers as soon as a match is found

This commit is contained in:
Emanuele Torre 2022-05-16 14:15:40 +02:00 committed by Jan Ekström
parent b4c73ed105
commit 9022b1b51d
1 changed files with 3 additions and 1 deletions

View File

@ -3405,8 +3405,10 @@ static struct demuxer *demux_open(struct stream *stream,
check_levels = d_force;
}
for (int n = 0; demuxer_list[n]; n++) {
if (strcmp(demuxer_list[n]->name, force_format) == 0)
if (strcmp(demuxer_list[n]->name, force_format) == 0) {
check_desc = demuxer_list[n];
break;
}
}
if (!check_desc) {
mp_err(log, "Demuxer %s does not exist.\n", force_format);