[FFmpeg-devel] [PATCH 2/2] avformat/isom: move some condition checks outside of loop
Zhao Zhili
quinkblack at foxmail.com
Sat Jun 27 06:22:50 EEST 2020
---
libavformat/isom.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/libavformat/isom.c b/libavformat/isom.c
index e34d3f2195..bddcd6364f 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -430,9 +430,11 @@ int ff_mov_iso639_to_lang(const char lang[4], int mp4)
int i, code = 0;
/* old way, only for QT? */
- for (i = 0; lang[0] && !mp4 && i < FF_ARRAY_ELEMS(mov_mdhd_language_map); i++) {
- if (!strcmp(lang, mov_mdhd_language_map[i]))
- return i;
+ if (lang[0] && !mp4) {
+ for (i = 0; i < FF_ARRAY_ELEMS(mov_mdhd_language_map); i++) {
+ if (!strcmp(lang, mov_mdhd_language_map[i]))
+ return i;
+ }
}
/* XXX:can we do that in mov too? */
if (!mp4)
--
2.25.1
More information about the ffmpeg-devel
mailing list