From patchwork Sun Mar 26 07:41:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyan Doshi X-Patchwork-Id: 40837 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:7a30:b0:df:834d:2c1a with SMTP id t48csp500347pzh; Sun, 26 Mar 2023 00:42:17 -0700 (PDT) X-Google-Smtp-Source: AKy350aVALGpMfxKSMq2MXChawWakNQI9blW/b2OG80a8tDKM8SDgnVwJ5r7S4JPKjQskWBiDEfC X-Received: by 2002:a17:906:b24e:b0:930:21a:c80 with SMTP id ce14-20020a170906b24e00b00930021a0c80mr8499914ejb.47.1679816537798; Sun, 26 Mar 2023 00:42:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679816537; cv=none; d=google.com; s=arc-20160816; b=DUP+Ts9EyLtnfsFMtEyPEllitkqBwG0z/yKwfJlZ5ZKu19w7nbR9bu5T5nCZUdX1Vy J+SvT8jwX7nM0SNNGKMhCwnFlQZHT6wOSegQr2OKlmLOrmtsyKyazbCvUYt/alSoghbQ khN4XEG1eFkLmSd4x/3ebeanCK46tsLOCR6wnKSPPEtuF/iQm8e3qOTkZmYjGFZunaYO /O04TUA+Y4gmsG+UElHhwe0vsPqO7LX98BXTjDaGdCdH9Lrivtrf5NVBUptVRGM4MIcD 3ExEYft5221jCrZYasRMwHy3Q6tHOy1Q8KdFSWPoERrQFP5fsjwXwpT6gRUCaCwu88Vl asXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=uv7zB/5JNLP/QfXspcAeOPXgRcZQQ8Slk9Eaq9Q5HrY=; b=PqNNMGlqpIi1xjc1xJdwqbleuctJKdS2yH3InHzlqYJ7rm98HPX1SueADqjXy5ME9S m1bju7imyMl84ZuHJ0ZzYxNTjumd4H+fe62JHvNqPhma5k4jy6OjKq0D45jj3s3q6XPZ 2F+e8pEQ6OOVumnZDE6uDb7MI6FXdPRBUDmeHGTCgDitwKDRR0ANAyEa2vMtwyq+H9q7 vzxout4en8ZZS2pojf2xQ9cUwSPrTPThKXsTqRxpR65fAr04j8VW4UPay63n+h9PxcOT wnU42X1E5Od9aXR31pT4YRlAf8naQlp2tHCrmoEsGAew0sxRpMDYIhAR6f0NrF88NTKp 09+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id qf31-20020a1709077f1f00b009334e181cf0si6135125ejc.47.2023.03.26.00.42.15; Sun, 26 Mar 2023 00:42:17 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1425668C7AF; Sun, 26 Mar 2023 10:42:12 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 4Gp5KN7fd3wN 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 */