From patchwork Thu Apr 4 10:29:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Storsj=C3=B6?= X-Patchwork-Id: 47796 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:24a8:b0:1a3:b6bb:3029 with SMTP id m40csp221599pzd; Thu, 4 Apr 2024 03:29:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCULyKM2QBXZ3p9SV3FHjT0Y3IWHBpVE91dIcbvbHl2mVjJaFWOVV+ZZUUnjLPOKwnSHXheMyiDGxHx1Ij8EyisFrLK26kPdmFBvXQ== X-Google-Smtp-Source: AGHT+IHdcH/qNEkQQAEJW374sDjjHSXmGzK6w24Yk5uwPbIk1pqexZ9bQ46+hrPfKeNCrTaCVTPS X-Received: by 2002:a50:9e66:0:b0:56e:441:8a94 with SMTP id z93-20020a509e66000000b0056e04418a94mr1799558ede.22.1712226557762; Thu, 04 Apr 2024 03:29:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712226557; cv=none; d=google.com; s=arc-20160816; b=uZXb3zKzm2Q3iLac9klTqIiixmxZuk4tSQEteyhv6A2OVO1fZhhxhfbhjQcHQmDABf GL2KzZX2kxHBuqyd0ZsrOsbqAsREeYE/Z0oFwXmUkobMn0d1IMTEJ1GxvBY2G09ab4YA n2OtQUjFXxmOgrZ8p+arsjRq3dTIXHNkyeFMXe9mhYYirh+d9N/qG1VJqcmQPcuTEzAY WTU3fWPGBmfyqFqDMxjQ/z65RExWx86eNTxFvudzBxzLpTGQS2XkZf2AXPHqIPNmq7KZ AQiV68mTiADWgdefP6NAfpbMvwkBD0fmxWKa3p2Z2c9pn7osrndkTsHtiBAyz8iW9KoQ UB3w== 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 :dkim-signature:delivered-to; bh=uLwN8RPb7cXUnAUHH1dFiutesaePEB7E2MkkZplHU24=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=X+Hl6i/jDtFOzDqr+2Bf22IKzfvTjUSc88TVy/Hpr6oF/BDtDERTcqVBsPw5OXNRi4 842uO4M7Bz8lePH6gCjv1IoYr67i+ommKitb7qFgcx03Yv73eBMlhck7JrQc9SY3E8j9 WYpjoxOx3aTadz0imwOHu0cJc7jEAt53E+ckB8QPMCnD0qN0To8BJIvw+tpr5gJYuwG/ pmIqclf/UyyM8n4b22vkYa+MOAWj3sDBdeLbE6kGqgFTwaiu/oQI700NRqObcFKIwWnR g6dxvekoDuxuGzezy+RfxVSAMDXqekq0Ab6K4leE6ue+sSc7mscCqxuqWWiF1sfwxnKN Xzrw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@martin-st.20230601.gappssmtp.com header.s=20230601 header.b=p2gQey36; 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 b21-20020a50ccd5000000b0056dfbd9a57fsi2032086edj.116.2024.04.04.03.29.17; Thu, 04 Apr 2024 03:29: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; dkim=neutral (body hash did not verify) header.i=@martin-st.20230601.gappssmtp.com header.s=20230601 header.b=p2gQey36; 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 3646E68C1BC; Thu, 4 Apr 2024 13:29:15 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6F19D68C1BC for ; Thu, 4 Apr 2024 13:29:08 +0300 (EEST) Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2d476d7972aso10869831fa.1 for ; Thu, 04 Apr 2024 03:29:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20230601.gappssmtp.com; s=20230601; t=1712226547; x=1712831347; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=f0ieBNu9Ux/IzRmBcVZP7RuP8Nlg6g6rj2sKxsTAGJA=; b=p2gQey362//uEpjRjZmTotZS1SmLCXWsbhhGZSotzPWMjGqN5WO9CJlZwfsWPZg18L lAG19lAy0MWRajqPKB+gXksoNCKQaT+aTUeoknDgclGE6/r0eYTuP81udPtrJ2FSn+uF BvcvREEpviIn4oJumx3a2aKNZi+JT3481wED8woe7LROjr5um9OtUPKIfByzTBFWhU5f Ik2FfKNcUUwg48LFWSsCUF0NDLWizY8uByS8sNKdp506jhFT6RMva/ZFowYv82sBFe1V krLL86ymXjkL1zVPspkjji6ubQaVBwI+8MmJjrZkppWLLelqL00UzYe3WQHLdvjphGFo WW8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712226547; x=1712831347; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=f0ieBNu9Ux/IzRmBcVZP7RuP8Nlg6g6rj2sKxsTAGJA=; b=UZnbrwFLzns7qbbZpMs6uEcjF/jC996wdTPASH8rnafbIPfY0L1LSqLui5V5zLmeub /6HUsUirbvrSExbvvIAiYAiRnOwj4rXF2UcaESdiJ58fMOZ7E4RC9TB3G1psSMJf5cSQ ikCitlmDRacU3i9RqZJqIIyDXi9orlZW1Kjq/oHjOCQrRBU7nM2msYXU+eQEGgsikVgz FcN9IpP7uquU8vlKZ7m+Ui65MPX2NUdMr78xRDkw0Tq/MxWV8r8tF9qCUpOA29Oflggn jBSbmDTvt8qA0R0giFbVXqgR4W52/VQEySdHWNSKAsG87mAcEeXnmQZxTAzaBWMQ6/TU To5Q== X-Gm-Message-State: AOJu0Yx6Xt9Poxw0VySAWa5hwFLDigO13eouZMDV2vH7LsB1cevE8HY6 wV18u2r+scwZIMJKyp0MIwNn4a37NqUtJxPcncyR2cu5Qiz71/ATW+ep4wj8MppM72MKATyqRQk KMYgr X-Received: by 2002:a2e:9912:0:b0:2d7:f26:9a9f with SMTP id v18-20020a2e9912000000b002d70f269a9fmr2050527lji.4.1712226547625; Thu, 04 Apr 2024 03:29:07 -0700 (PDT) Received: from localhost (host-114-191.parnet.fi. [77.234.114.191]) by smtp.gmail.com with ESMTPSA id j9-20020a2eb3c9000000b002d711e8d397sm1900079lje.94.2024.04.04.03.29.07 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 04 Apr 2024 03:29:07 -0700 (PDT) From: =?utf-8?q?Martin_Storsj=C3=B6?= To: ffmpeg-devel@ffmpeg.org Date: Thu, 4 Apr 2024 13:29:06 +0300 Message-Id: <20240404102906.62843-1-martin@martin.st> X-Mailer: git-send-email 2.39.3 (Apple Git-146) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] tests/movenc: Validate that normal muxer usage doesn't print warnings 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: QOyqNNRVMyaP We have test to make sure that certain configurations do print warnings. However, the normal operation of the muxer within this test always printed a warning, so those tests to check for extra warnings didn't essentially guard anything. The warning that always was printed, "track 1: codec frame size is not set" was not present in the libav fork where this testcase originated, it was removed in f234e8a32e6c69d7b63f8627f278be7c2c987f43. Set the frame size for the audio stream to silence the warning, and use this frame size in a couple later calculations, and check that one test configuration doesn't print warnings. Setting the frame size apparently changes the rounding of a timestamp in the ismv muxing testcase. --- libavformat/tests/movenc.c | 10 ++++++++-- tests/ref/fate/movenc | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/libavformat/tests/movenc.c b/libavformat/tests/movenc.c index 77f73abdfa..12a3632d4e 100644 --- a/libavformat/tests/movenc.c +++ b/libavformat/tests/movenc.c @@ -215,6 +215,7 @@ static void init_fps(int bf, int audio_preroll, int fps) st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; st->codecpar->codec_id = AV_CODEC_ID_AAC; st->codecpar->sample_rate = 44100; + st->codecpar->frame_size = 1024; st->codecpar->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO; st->time_base.num = 1; st->time_base.den = 44100; @@ -232,9 +233,10 @@ static void init_fps(int bf, int audio_preroll, int fps) frames = 0; gop_size = 30; duration = video_st->time_base.den / fps; - audio_duration = 1024LL * audio_st->time_base.den / audio_st->codecpar->sample_rate; + audio_duration = (long long)audio_st->codecpar->frame_size * + audio_st->time_base.den / audio_st->codecpar->sample_rate; if (audio_preroll) - audio_preroll = 2048LL * audio_st->time_base.den / audio_st->codecpar->sample_rate; + audio_preroll = 2 * audio_duration; bframes = bf; video_dts = bframes ? -duration : 0; @@ -442,6 +444,7 @@ int main(int argc, char **argv) // Similar to the previous one, but with input that doesn't start at // pts/dts 0. avoid_negative_ts behaves in the same way as // in non-empty-moov-no-elst above. + init_count_warnings(); init_out("empty-moov-no-elst"); av_dict_set(&opts, "movflags", "+frag_keyframe+empty_moov", 0); init(1, 0); @@ -449,6 +452,9 @@ int main(int argc, char **argv) finish(); close_out(); + reset_count_warnings(); + check(num_warnings == 0, "Unexpected warnings printed"); + // Same as the previous one, but disable avoid_negative_ts (which // would require using an edit list, but with empty_moov, one can't // write a sensible edit list, when the start timestamps aren't known). diff --git a/tests/ref/fate/movenc b/tests/ref/fate/movenc index 968a3d27f2..0c77f5187c 100644 --- a/tests/ref/fate/movenc +++ b/tests/ref/fate/movenc @@ -20,7 +20,7 @@ write_data len 828, time nopts, type unknown atom - write_data len 728, time 999999, type sync atom moof write_data len 812, time nopts, type unknown atom - write_data len 148, time nopts, type trailer atom - -92ce825ff40505ec8676191705adb7e7 4439 ismv +d2df24d323f4a8896441cd91203ac5f8 4439 ismv write_data len 36, time nopts, type header atom ftyp write_data len 1123, time nopts, type header atom - write_data len 796, time 0, type sync atom moof