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 AEC1D4B62E for ; Wed, 10 Jul 2024 16:03:00 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 16BBC68DB46; Wed, 10 Jul 2024 19:02:57 +0300 (EEST) Received: from mail-oa1-f51.google.com (mail-oa1-f51.google.com [209.85.160.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 95B2968D9FD for ; Wed, 10 Jul 2024 19:02:50 +0300 (EEST) Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-25e19ad0050so887394fac.0 for ; Wed, 10 Jul 2024 09:02:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720627369; x=1721232169; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=L0BJv5557+wD5DO6UfEcxtUw1k7OTiewFhSYNeqyiAw=; b=jMsxZ0T5WIaMy/1M408VCSAWlulCzpzPGJHzBZwboQ0mmagjeteov280+kRpv3N/3e a/A6jSyoqIZvp9gi3X3PATT7m/bcSo55eF3ijqbMZxfvNCs8LUDvj9ZOjjsajubQ5ZaH gARqd1Z5onYrOkhdYM8MVX3XX05NXN5OIyykRuCZ0Bym+S90ifILeUFERTvRw+cBebn7 Xgvl/o7GLJRLkq+o0icuMUMdA/8X8qyhBky2Uq+YOfiDY95r2suGPHXG8AE8tz54OF66 iE417WEFYeaWgIKbk7UjYCYhsd12yntZQSdhCUY0iKra1YuNby0WsGt9OA16BSrfrNPZ dt3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720627369; x=1721232169; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=L0BJv5557+wD5DO6UfEcxtUw1k7OTiewFhSYNeqyiAw=; b=O/SJVy0qNL/0XllzhXOg4cqVOCL8FkGq3JXX4euCTwSq4hQOeMsaqaTDf1wNTASQqH M6O3OCrS0bvshYowLYfT5a9ksDxOiEzOB+Qz8zdyZLaI+FX4ZdS+HXWxxhF2xNHis5WP trybWRO3KsvqxUapirec9dp6HCn/IBdfmyeEi2n6E4ojVn6jtzec1AxMXqi9HH29CQs7 UeGBvCvH5tiO4L3GV0MDIzCaiTvn1mJXzCRWc4bi+Rm/SJheLJORFrjrnTcdACEHtMxE ffi/1eF8kcgG231HW3ibDVji89RizUu0wv3P0q107XXd73/jweJ+AAmZGikcVf/E9mZc nr3A== X-Gm-Message-State: AOJu0Yw7pOvkgB9AlgRZvtW8gUy2dxVJWziELYTFVi4STRzp1zIHQUQn QjjKdF7lZMMUoZ7Mhz1blJqZZn0SMC4uWytJfr/E+lgMrN2mYwKaSV8ksA== X-Google-Smtp-Source: AGHT+IEr9iBi5Lnket/9k7NLtPu87IqECG+yDIbOGUAflFa7gXcGIZC/GZGsMRO9zwIS20vqTiNf7g== X-Received: by 2002:a05:6871:5308:b0:25e:b7e1:d20d with SMTP id 586e51a60fabf-25eb7e1d44emr5368011fac.0.1720627368431; Wed, 10 Jul 2024 09:02:48 -0700 (PDT) Received: from [192.168.1.35] (c-68-56-149-176.hsd1.mi.comcast.net. [68.56.149.176]) by smtp.gmail.com with ESMTPSA id af79cd13be357-79f19089221sm205946485a.76.2024.07.10.09.02.48 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Jul 2024 09:02:48 -0700 (PDT) Message-ID: Date: Wed, 10 Jul 2024 12:02:47 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: <20240709172140.48976-1-jamrial@gmail.com> Content-Language: en-US-large From: Leo Izen Autocrypt: addr=leo.izen@gmail.com; keydata= xjMEZZw8HxYJKwYBBAHaRw8BAQdAgcfI+LbtjWarA7LQu6/WAPlKkn9tn4HalmHgGVhMUdzN KkxlbyBJemVuIChUcmFuZXB0b3JhKSA8bGVvLml6ZW5AZ21haWwuY29tPsKTBBMWCgA7FiEE HYMKC85GcJ4gOyb8dk5I6kgiGDMFAmWcPB8CGwMFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcC F4AACgkQdk5I6kgiGDOnGAEA+oJFwblAblnhK+T5a5EuEbXMTZG4FkYTYz0VmjJ0NHIA/Rn9 ZE9+EEsH8fmT0hRJSiM3+zbkwQJA9gVVYAek9kMKzjgEZZw8HxIKKwYBBAGXVQEFAQEHQDes 4thejF9AU2rkGuDuut3CQYwB4SVpI4EzU8uvPJgfAwEIB8J4BBgWCgAgFiEEHYMKC85GcJ4g Oyb8dk5I6kgiGDMFAmWcPB8CGwwACgkQdk5I6kgiGDOv3QD+PLXrL0Ihk675Ip5FG+VJOodN 6e+5n3iYC6wJ75eqG3EA/1nCywoGXlCYuzXgq3el6NOn+8awwaXcTVJFzZCRbe8M In-Reply-To: <20240709172140.48976-1-jamrial@gmail.com> Subject: Re: [FFmpeg-devel] [PATCH] avformat/mov: ensure pasp box derived SAR is used if present 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 7/9/24 1:21 PM, James Almer wrote: > It's meant to override any codec specific (but container level) information, > but its position is not guaranteed, so apply the values after the entire trak > structure has been parsed. > Also, replace the ugly roundabout int -> double -> int method to set SAR from > existing dimensions while at it. > > Signed-off-by: James Almer > --- > libavformat/isom.h | 2 ++ > libavformat/mov.c | 16 ++++++++++++---- > 2 files changed, 14 insertions(+), 4 deletions(-) > > diff --git a/libavformat/isom.h b/libavformat/isom.h > index a0498f45e5..5b6125a908 100644 > --- a/libavformat/isom.h > +++ b/libavformat/isom.h > @@ -215,6 +215,8 @@ typedef struct MOVStreamContext { > int timecode_track; > int width; ///< tkhd width > int height; ///< tkhd height > + int h_spacing; ///< pasp hSpacing > + int v_spacing; ///< pasp vSpacing > int dts_shift; ///< dts shift when ctts is negative > uint32_t palette[256]; > int has_palette; > diff --git a/libavformat/mov.c b/libavformat/mov.c > index ced4b2e6b3..ce95842ce5 100644 > --- a/libavformat/mov.c > +++ b/libavformat/mov.c > @@ -1287,14 +1287,18 @@ static int mov_read_pasp(MOVContext *c, AVIOContext *pb, MOVAtom atom) > const int num = avio_rb32(pb); > const int den = avio_rb32(pb); > AVStream *st; > + MOVStreamContext *sc; > > if (c->fc->nb_streams < 1) > return 0; > st = c->fc->streams[c->fc->nb_streams-1]; > + sc = st->priv_data; > + > + av_log(c->fc, AV_LOG_TRACE, "pasp: hSpacing %d, vSpacing %d\n", num, den); > > if (den != 0) { > - av_reduce(&st->sample_aspect_ratio.num, &st->sample_aspect_ratio.den, > - num, den, 32767); > + sc->h_spacing = num; > + sc->v_spacing = den; > } If den == 0, nothing is assigned at all, but if den != 0 and if num == 0, we assign 0 to h_spacing, which will end up doing nothing because we check h_spacing && v_spacing later on in the other line you add. Is this intentional? Is this desired behavior? etc. - Leo Izen (Traneptora) _______________________________________________ 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".