From patchwork Sat Jun 27 03:22:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Zhili X-Patchwork-Id: 20638 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 378C044B188 for ; Sat, 27 Jun 2020 06:23:08 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 14A5168B1AF; Sat, 27 Jun 2020 06:23:08 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from qq.com (out203-205-221-153.mail.qq.com [203.205.221.153]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 819EC68A79B for ; Sat, 27 Jun 2020 06:23:00 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1593228175; bh=sw4SmQ6Vh2Nj1fGcpsL/52Hhm1lenkdC398nyORDwN0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=qgfv7stkubkzp8fkct+pzwJ52mlI0nvDgFhkrqPSearWHf92LJfD2x16nvqlz/XNO m53yQuRw8V5449Tr6CSO7/d78e0IK5u+A9eVxJrjQLPmjSHdQ25xZLVYxmTqqiSG1D i+Z+gTiQvF4rTAqLcABY/9BQ8lNSZFnYozeI3oM8= Received: from localhost.localdomain ([27.46.106.105]) by newxmesmtplogicsvrsza7.qq.com (NewEsmtp) with SMTP id 5B53C20A; Sat, 27 Jun 2020 11:22:53 +0800 X-QQ-mid: xmsmtpt1593228174t6qy1uh9v Messag-ID: X-QQ-XMAILINFO: MumY3TtZILbsrXSAe3bkcsZ8e05ThHFr0rLX/Vn3DH7hYGuv8O2r9lk2I6nFpp hsVunyV4xOALajbOSO6yf63W2avL6RyQOg9dhWjPnzE13cMv+NSBN5P24CeZEacOgxS5lMjtNFe3 v2W4NyURpd+oPJjjJN5dfSbi/ARsaeUZW3Yj3A7C7ctOIDdQizJ3KxKK9neyfhatnQwccfx0LRfW N1Dru+6sIUBgrJUZAD+bQ7gQlFEG3z9UqT6/aKx+qFW65IaJry9y6L6NP+GLQiEe0OSGg4GP+FHh ztHfrrNzkd+7DqvWfGJxfpO8R34DoKnEJElYcCFJjO7hef3lA6E7ps0/3v6GXcsqVqVPBwgPVH5K jRAHQoa+ZQiWzBioceUZj++2E47M33aYZPHjGZBNMMGi1uJbP1mivyqMYy3gOGor93lFbJJTiVx3 8DWy4TnweWcl8zttTp2fU9r+sVZHnM9+NTG1uikM6NEljEpei5I8zWwc3cllT+0QyKwHMcaqmZrZ hTMT9qlkIF+VeGClqDJ0RgOTmHll359Z3kH/EnnCdmocoqt+hKnkgoDNFOiesbHh2FyUEkBWsp8w 0tiAOy5GRsPYk0kGinF2s/Jt1xlJmECeLcHIT8czdXDZazNPMg5zuLyAJ3mi9Zcn9LIMbrfUu4K2 rSBjKCkgD1XKVzFEEaXC6FaoMrMJBMpMcruMGF1hqLYziTOtuyfD52njmaH4KslEeoXnU7MR/3ni Gw From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Sat, 27 Jun 2020 11:22:50 +0800 X-OQ-MSGID: <20200627032250.119935-2-quinkblack@foxmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200627032250.119935-1-quinkblack@foxmail.com> References: <20200627032250.119935-1-quinkblack@foxmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] avformat/isom: move some condition checks outside of loop X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Zhao Zhili Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Message-Id: <20200627032308.14A5168B1AF@ffbox0-bg.mplayerhq.hu> --- 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)