summaryrefslogtreecommitdiffstats
path: root/player/loadfile.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-09-28 00:14:54 +0200
committerwm4 <wm4@nowhere>2020-09-28 00:14:54 +0200
commite1536193cbca6506d31b1139cd35bd575bf6e368 (patch)
tree7cd044bc5b68a47e4f2908aabf777b6bdbe8f8d2 /player/loadfile.c
parent55d7f9ded197d82d172b7baf74b1a07640361ae8 (diff)
downloadmpv-e1536193cbca6506d31b1139cd35bd575bf6e368.tar.bz2
mpv-e1536193cbca6506d31b1139cd35bd575bf6e368.tar.xz
player: cosmetically change around some code
Is this better?
Diffstat (limited to 'player/loadfile.c')
-rw-r--r--player/loadfile.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/player/loadfile.c b/player/loadfile.c
index cb6c1060d7..0adc8e351d 100644
--- a/player/loadfile.c
+++ b/player/loadfile.c
@@ -879,20 +879,20 @@ void autoload_external_files(struct MPContext *mpctx, struct mp_cancel *cancel)
}
for (int i = 0; list && list[i].fname; i++) {
- char *filename = list[i].fname;
- char *lang = list[i].lang;
+ struct subfn *e = &list[i];
+
for (int n = 0; n < mpctx->num_tracks; n++) {
struct track *t = mpctx->tracks[n];
- if (t->demuxer && strcmp(t->demuxer->filename, filename) == 0)
+ if (t->demuxer && strcmp(t->demuxer->filename, e->fname) == 0)
goto skip;
}
- if (list[i].type == STREAM_SUB && !sc[STREAM_VIDEO] && !sc[STREAM_AUDIO])
+ if (e->type == STREAM_SUB && !sc[STREAM_VIDEO] && !sc[STREAM_AUDIO])
goto skip;
- if (list[i].type == STREAM_AUDIO && !sc[STREAM_VIDEO])
+ if (e->type == STREAM_AUDIO && !sc[STREAM_VIDEO])
goto skip;
- if (list[i].type == STREAM_VIDEO && (sc[STREAM_VIDEO] || !sc[STREAM_AUDIO]))
+ if (e->type == STREAM_VIDEO && (sc[STREAM_VIDEO] || !sc[STREAM_AUDIO]))
goto skip;
- int first = mp_add_external_file(mpctx, filename, list[i].type, cancel);
+ int first = mp_add_external_file(mpctx, e->fname, e->type, cancel);
if (first < 0)
goto skip;
@@ -900,9 +900,9 @@ void autoload_external_files(struct MPContext *mpctx, struct mp_cancel *cancel)
struct track *t = mpctx->tracks[n];
t->auto_loaded = true;
t->attached_picture =
- t->type == STREAM_VIDEO && list[i].type == STREAM_VIDEO;
+ t->type == STREAM_VIDEO && e->type == STREAM_VIDEO;
if (!t->lang)
- t->lang = talloc_strdup(t, lang);
+ t->lang = talloc_strdup(t, e->lang);
}
skip:;
}