From patchwork Sat Jun 27 03:22:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Zhili X-Patchwork-Id: 20639 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 2FF3544B188 for ; Sat, 27 Jun 2020 06:23:09 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2277268B20F; Sat, 27 Jun 2020 06:23:09 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from qq.com (out203-205-221-221.mail.qq.com [203.205.221.221]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 83B4668B1B2 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=T0rIRSxn/zbNA2wERGh0k6MIg80tZWNGqmg8jiNzxbM=; h=From:To:Cc:Subject:Date; b=XQEPXztBoFT83iHuWepuHPD/Tomvi7Ml5eeHlK9QFoJjvrHIsYtGASh6f70c0iTNF Yd5VAnLEtNGPRPNW03OMI8Ha82aUjHpDgyP3Z3UgD+ANcydJSk1zUIptPuxC6N5hdz bljasdziYCc4pKaWoMFsHC0FeTfTTNH/zNoKDz4E= 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: xmsmtpt1593228173tpxgvu4o7 Messag-ID: X-QQ-XMAILINFO: MZsrnY6ReKvOs+aOtcSuWNKQyvck96I71WDcmcCs8gjxwZYid3+FKS9+fR9fV5 2HoAonKv3pm43xXOf3JHe4BNvUdAnbvjRx3kEH3vTUQgBp74ruhOedsQZ9P3LX6WWr1Yavwfarhs CD81CJFZdcPnrA8L4e+MzG61ujueQcjEDK7iaqH8w/iObgenqivavyDTsjP+WSFVQFG6U9jOGVKn A1xR1+TEv8tjZslSH/CfuoeT3Igc3HxhRGIjP0t86dhdoLmCBon7NDhJGm95OFq1Lu6AR5eUmzPN itCTayP2d+7cN7kUEJ2ib3z+zSlrxYAesbInvazYUK1RE4wr482lSQ1zw82mhgt6kVBWmsXCPVSA u5f0VYB+8VP+GYCqnms8MZuvWgWSWpKVIsnXSPU4UgsfqCbBJ5u2eLeKofY44exuQVy4M8HuWjq1 KmIf5IuOSK5FIKD1znQx9wIUuaDU78L45r85zRL9SQEtwK7KB/QaYZigo67dhwFklGd7Z/e+e+0J dvOBU+kAQoqzg/LzXo2OtwG3rMb+WH66PUgXgJyDu4R9b+1DkBU1F9HCBzFVWd9FO195iOhGz3cB fp4rZnRmxNqjvcau5hvMa6Y/yP4Ji6ABz9eYUDsiOZUti2CQG+PLAl9t/Vnp2xBAQnR4ZSui681G 3nU8ff4h5bhbIWrk4htnZyuKS3y9z0KBQN2atLjjy/vA2RZzqb4+eeiSg= From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Sat, 27 Jun 2020 11:22:49 +0800 X-OQ-MSGID: <20200627032250.119935-1-quinkblack@foxmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] avformat/isom: update mov_mdhd_language_map 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: <20200627032309.2277268B20F@ffbox0-bg.mplayerhq.hu> This is a map from 'Macintosh Language Codes' to 'ISO639-2/T'. Some items in the map are ISO639-2/B, some are ISO639-1. German: ger => deu Dutch: dut = nld Swedish: sve => swe Icelandic: ice => isl Croatian: hr => hrv Chinese: chi => zho Faroese: fo => fao Farsi/Persian: "" => fas Flemish: "" => nld Irish: iri => gle Albanian: alb => sqi Serbian: sr => srp Macedonian: mac => mkd Armenian: arm => hye Georgian: geo => kat MongolianCyr: "" => mon Tibetan: tib => bod Punjabi: pa => pan Sinhala: "" => sin Burmese: bur => mya Kinyarwanda: "" => kin Nyanja: "" => nya Welsh: wel => cym Basque: baq => eus --- libavformat/isom.c | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/libavformat/isom.c b/libavformat/isom.c index 44c7b13038..e34d3f2195 100644 --- a/libavformat/isom.c +++ b/libavformat/isom.c @@ -395,24 +395,33 @@ const AVCodecTag ff_codec_movdata_tags[] = { /* http://developer.apple.com/documentation/mac/Text/Text-368.html */ /* deprecated by putting the code as 3*5 bits ASCII */ static const char mov_mdhd_language_map[][4] = { - /* 0-9 */ - "eng", "fra", "ger", "ita", "dut", "sve", "spa", "dan", "por", "nor", - "heb", "jpn", "ara", "fin", "gre", "ice", "mlt", "tur", "hr "/*scr*/, "chi"/*ace?*/, - "urd", "hin", "tha", "kor", "lit", "pol", "hun", "est", "lav", "", - "fo ", "", "rus", "chi", "", "iri", "alb", "ron", "ces", "slk", - "slv", "yid", "sr ", "mac", "bul", "ukr", "bel", "uzb", "kaz", "aze", - /*?*/ - "aze", "arm", "geo", "mol", "kir", "tgk", "tuk", "mon", "", "pus", - "kur", "kas", "snd", "tib", "nep", "san", "mar", "ben", "asm", "guj", - "pa ", "ori", "mal", "kan", "tam", "tel", "", "bur", "khm", "lao", - /* roman? arabic? */ + /* 0: [English] [French] [German] [Italian] [Dutch] [Swedish] [Spanish] [Danish] [Portuguese] [Norwegian] */ + "eng", "fra", "deu", "ita", "nld", "swe", "spa", "dan", "por", "nor", + /* 10: [Hebrew] [Japanese] [Arabic] [Finnish] [Greek] [Icelandic] [Maltese] [Turkish] [Croatian] [Traditional Chinese] */ + "heb", "jpn", "ara", "fin", "gre", "isl", "mlt", "tur", "hrv", "zho", + /* 20: [Urdu] [Hindi] [Thai] [Korean] [Lithuanian] [Polish] [Hungarian] [Estonian] [Latvian] [Sami] */ + "urd", "hin", "tha", "kor", "lit", "pol", "hun", "est", "lav", "", + /* 30: [Faroese] [Farsi/Persian] [Russian] [Simplified Chinese] [Flemish] [Irish] [Albanian] [Romanian] [Czech] [Slovak] */ + "fao", "fas", "rus", "zho", "nld", "gle", "sqi", "ron", "ces", "slk", + /* 40: [Slovenian] [Yiddish] [Serbian] [Macedonian] [Bulgarian] [Ukrainian] [Belarusian] [Uzbek] [Kazakh] [Azerbaijani] */ + "slv", "yid", "srp", "mkd", "bul", "ukr", "bel", "uzb", "kaz", "aze", + /* 50: [AzerbaijanAr] [Armenian] [Georgian] [Moldavian] [Kirghiz] [Tajiki] [Turkmen] [Mongolian] [MongolianCyr] [Pashto] */ + "aze", "hye", "kat", "mol", "kir", "tgk", "tuk", "mon", "mon", "pus", + /* 60: [Kurdish] [Kashmiri] [Sindhi] [Tibetan] [Nepali] [Sanskrit] [Marathi] [Bengali] [Assamese] [Gujarati] */ + "kur", "kas", "snd", "bod", "nep", "san", "mar", "ben", "asm", "guj", + /* 70: [Punjabi] [Oriya] [Malayalam] [Kannada] [Tamil] [Telugu] [Sinhala] [Burmese] [Khmer] [Lao] */ + "pan", "ori", "mal", "kan", "tam", "tel", "sin", "mya", "khm", "lao", + /* 80: [Vietnamese] [Indonesian] [Tagalog] [MalayRoman] [MalayArabic] [Amharic] [Galla] [Oromo] [Somali] [Swahili] */ "vie", "ind", "tgl", "may", "may", "amh", "tir", "orm", "som", "swa", - /*==rundi?*/ - "", "run", "", "mlg", "epo", "", "", "", "", "", - /* 100 */ + /* 90: [Kinyarwanda] [Rundi] [nya] [Malagasy] [Esperanto] */ + "kin", "run", "nya", "mlg", "epo", "", "", "", "", "", + /* 100: */ "", "", "", "", "", "", "", "", "", "", + /* 110: */ "", "", "", "", "", "", "", "", "", "", - "", "", "", "", "", "", "", "", "wel", "baq", + /* 120: [Welsh] [Basque] */ + "", "", "", "", "", "", "", "", "cym", "eus", + /* 130: [Catalan] [Latin] [Quechua] [Guarani] [Aymara] [Tatar] [Uighur] [Dzongkha] [JavaneseRom] */ "cat", "lat", "que", "grn", "aym", "tat", "uig", "dzo", "jav" }; 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)