summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorEmanuele Torre <torreemanuele6@gmail.com>2022-05-16 14:15:40 +0200
committerJan Ekström <jeebjp@gmail.com>2022-05-21 23:32:40 +0300
commit9022b1b51dc1204760f9d495e7b3b5550f501bf3 (patch)
treedb9aabd1379b2d7e53bd1d93dfffda817a2700e1 /demux
parentb4c73ed10590ac7b7186f887ab1e24eeb68b35ce (diff)
downloadmpv-9022b1b51dc1204760f9d495e7b3b5550f501bf3.tar.bz2
mpv-9022b1b51dc1204760f9d495e7b3b5550f501bf3.tar.xz
demux: stop iterating over demuxers as soon as a match is found
Diffstat (limited to 'demux')
-rw-r--r--demux/demux.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/demux/demux.c b/demux/demux.c
index f6b0448791..29b5dccfc7 100644
--- a/demux/demux.c
+++ b/demux/demux.c
@@ -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);