From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 248A045343 for ; Sun, 26 Mar 2023 07:42:15 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C41D968C7A7; Sun, 26 Mar 2023 10:42:11 +0300 (EEST) Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D719068C639 for ; Sun, 26 Mar 2023 10:42:04 +0300 (EEST) Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4Pknvr65wpz9sbm for ; Sun, 26 Mar 2023 09:42:00 +0200 (CEST) From: Gyan Doshi To: ffmpeg-devel@ffmpeg.org Date: Sun, 26 Mar 2023 13:11:30 +0530 Message-Id: <20230326074130.1317-1-ffmpeg@gyani.pro> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/movenc: correct loci parameter handling X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: 3GPP TS 26.244 Table 8.10 specifies that longitude is written before latitude. The MOV demuxer already expects the correct order. So, write them in that order. However, the user supplied string may also be used in MOV mode which requires ISO 6709 format which specifies latitude first. The demuxer also exports the loci value in that format. So parser adjusted as well. --- libavformat/movenc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 68e7f8222b..c370922c7d 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -4021,13 +4021,13 @@ static int mov_write_loci_tag(AVFormatContext *s, AVIOContext *pb) return 0; ptr = t->value; - longitude = strtod(ptr, &end); + latitude = strtod(ptr, &end); if (end == ptr) { av_log(s, AV_LOG_WARNING, "malformed location metadata\n"); return 0; } ptr = end; - latitude = strtod(ptr, &end); + longitude = strtod(ptr, &end); if (end == ptr) { av_log(s, AV_LOG_WARNING, "malformed location metadata\n"); return 0; @@ -4048,8 +4048,8 @@ static int mov_write_loci_tag(AVFormatContext *s, AVIOContext *pb) avio_wb16(pb, lang); avio_write(pb, place, strlen(place) + 1); avio_w8(pb, 0); /* role of place (0 == shooting location, 1 == real location, 2 == fictional location) */ - avio_wb32(pb, latitude_fix); avio_wb32(pb, longitude_fix); + avio_wb32(pb, latitude_fix); avio_wb32(pb, altitude_fix); avio_write(pb, astronomical_body, strlen(astronomical_body) + 1); avio_w8(pb, 0); /* additional notes, null terminated string */ -- 2.39.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".