From patchwork Tue Jan 17 09:31:23 2023 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: 40060 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1d43:b0:b8:6755:f97e with SMTP id cs3csp1671861pzb; Tue, 17 Jan 2023 01:31:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXtfzZQ0fqayOCiekO8L7/AVEVqcWyar1QFc7q3KHd3eB+WXrT5NJ0K0LJZc4Y1cuU42JUdU X-Received: by 2002:a17:906:2e83:b0:7ad:bc7e:3ffd with SMTP id o3-20020a1709062e8300b007adbc7e3ffdmr1974785eji.42.1673947898730; Tue, 17 Jan 2023 01:31:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673947898; cv=none; d=google.com; s=arc-20160816; b=GItKHxb2+6SRNll/NTj/trBV0JagLjpl+OYNSfOheKInr3zk01CcDRPYPjFhR9QsRs 8lVkV5GC9zwWPLh1Fjl0LtSEMU32k9d96HMuSXy+HlRbY+FRzi05wGIbTPb7Toq1dwjO r4W9Np4h5wiE8M0yLJNEXhr9lt9g4+f26R9C5Y9ihCdlvG+SGqN9aHO9obpYvFjn6E+c zzQZi+ww2jTik4M0HdsAnCHTaSaAndyqZlrdVFYJrBB16i/zIPpGqoVP1lOVmaTyaKvv kxSUxg1a5CBdr86P1TEXHsFBe0YxfMwkHP/MmcJEwPnrfc0mr6HxgmDGfJYZp1qAyJzu dzxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc: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=tYuIFExicqgk/QBqCUMqCv+6+2Ox+zxcrgQ29RjEHBg=; b=u21Sz/GK7Udc/uatZHyp6U3zJiEai50MQ2GuStK7T9Y5huaQud7Eqp7VVBlon0FWR8 vbTcfap8bd8NHGz64oLGQ2BF3or55Xj4u5WcHpFy6V0RJjNQlhEDUPpnTONzuub3sV6v 0Hnbbmfd9l9HmwKHzmF2U683F+9cO1x7Qc/3q4AeB/AugpszqTfxg8Fa4AidTeOGUTDx 0oXhdJP1bzMQ6RAf/5dn73EAUDr02st6Uaxqx3tR2EleSamW/Fy8+8C8wmXUf8z/mxeV ku0iEf3n1ygc6fJnhvaxdQIr4HicXKbZ+eVvfubZOKN3bbrGpcVFh0Q8OtwpERVfip3k Sb0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@martin-st.20210112.gappssmtp.com header.s=20210112 header.b=G3ooQYrx; 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 e5-20020a17090658c500b0087305ff8c42si923938ejs.909.2023.01.17.01.31.38; Tue, 17 Jan 2023 01:31:38 -0800 (PST) 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.20210112.gappssmtp.com header.s=20210112 header.b=G3ooQYrx; 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 BA37068BE29; Tue, 17 Jan 2023 11:31:34 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A917968BDB5 for ; Tue, 17 Jan 2023 11:31:28 +0200 (EET) Received: by mail-il1-f173.google.com with SMTP id u8so15110704ilq.13 for ; Tue, 17 Jan 2023 01:31:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=GWqN38PmR+0piifuOcJMepsvjDmyHhYPTeirdKGrY1k=; b=G3ooQYrxK71Svb2zD1gXmri3B0AdIcjz7ToP671impeqmm7S5hmjyykZNmPSo2Jd8+ HJS8rDI7SizOlkxoD/iyRrF1m26wXvZnP8R1R3MdagMwOo//jJ7XpT6VQA/21gPfUPpN y2EkVcKeSCJijNfNsMgomM5vyv6igUPVhBnsHEaKiTQWf3uHsxy/k7z0Tp6Isae5rs2W Gy9vIr+fIxJw0F6g9is4tFzOl0LquLWx2WGrSaPAeu1dsZjZ3srrDc76NwCf+xT/t0AX WB1e5Bs9g5BjkCKCxwy3nU1prUgL/bKg++Ez8Ceo20g5aROEWjvXv7x/9SgSOHXm2XwD kBuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GWqN38PmR+0piifuOcJMepsvjDmyHhYPTeirdKGrY1k=; b=KLwpSS8vKR9TsWONNNl7II6uh2TGsZ2yP38sVS5fSwhElYhWsX7X1Otp2Yj2aJZBFo NVGP5MEDqcTPATMEe1JEVuCFt4nwwKsB6TUWBhaZEzm2ehmOn8XJZtqNdMHHaMSAH9Hs DEnG8ZXRPvYAGBSiCSyvbYw0vcaSSBcsnVM8iN54VH5LnYgIT9koFxTXpAB35VrKfQ0d XxFdzuU26S+pCNO4rbLP+4ScPks5jja9vCrT0qFQ5JpSahSnBcZDjEBf6h7TCvkk7qfq VPGFrMRwK2xTw5wcv7dqX8gViiVw4HyOT8ju4q8Oke6Hil1n3a3H3yAIVIWX6IoQfA+1 UlWg== X-Gm-Message-State: AFqh2krLCK3n7vJDZIzLVm0wD7gqouB60G0DIvYUocUu2cOts2ET/D+I XCHpab02VTU5VVYHBl6QRS5/T5XCgCJvp9tZfPk= X-Received: by 2002:a05:6e02:50e:b0:30e:dcfb:6b9d with SMTP id d14-20020a056e02050e00b0030edcfb6b9dmr2084315ils.3.1673947886878; Tue, 17 Jan 2023 01:31:26 -0800 (PST) Received: from localhost (dsl-tkubng21-58c01c-243.dhcp.inet.fi. [88.192.28.243]) by smtp.gmail.com with ESMTPSA id y12-20020a056e02178c00b0030258f9670bsm3247344ilu.13.2023.01.17.01.31.25 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 17 Jan 2023 01:31:26 -0800 (PST) From: =?utf-8?q?Martin_Storsj=C3=B6?= To: ffmpeg-devel@ffmpeg.org Date: Tue, 17 Jan 2023 11:31:23 +0200 Message-Id: <20230117093123.67731-1-martin@martin.st> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] mov: Reduce the verbosity of the warning about fragmented MP4 vs advanced edit lists 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 Cc: Derek Buitenhuis Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 3dFIqiOVlK1p Only warn if the advanced_editlist option is enabled (it is enabled by default though) so we don't print one warning for each track, and demote the warning to AV_LOG_LEVEL_VERBOSE; this message does get generated whenever parsing a fragmented MP4 file, regardless of whether the file actually uses multiple edits or not. Later when parsing the mov structures, the demuxer does warn if the file did contain multiple edits which would require the advanced_editlist option enabled for decoding correctly. Adjust the warning message for the case when the file seemed like it actually would have needed handling of advanced edit lists, to reflect the fact that it doesn't help to try set the option as it has been automatically disabled. --- libavformat/isom.h | 1 + libavformat/mov.c | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/libavformat/isom.h b/libavformat/isom.h index 64fb7065d5..5107b4eb74 100644 --- a/libavformat/isom.h +++ b/libavformat/isom.h @@ -286,6 +286,7 @@ typedef struct MOVContext { int use_absolute_path; int ignore_editlist; int advanced_editlist; + int advanced_editlist_autodisabled; int ignore_chapters; int seek_individually; int64_t next_root_atom; ///< offset of the next root atom diff --git a/libavformat/mov.c b/libavformat/mov.c index e0b7df2815..6ab43b00c6 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -4063,10 +4063,15 @@ static void mov_build_index(MOVContext *mov, AVStream *st) } } - if (multiple_edits && !mov->advanced_editlist) - av_log(mov->fc, AV_LOG_WARNING, "multiple edit list entries, " - "Use -advanced_editlist to correctly decode otherwise " - "a/v desync might occur\n"); + if (multiple_edits && !mov->advanced_editlist) { + if (mov->advanced_editlist_autodisabled) + av_log(mov->fc, AV_LOG_WARNING, "multiple edit list entries, " + "not supported in fragmented MP4 files\n"); + else + av_log(mov->fc, AV_LOG_WARNING, "multiple edit list entries, " + "Use -advanced_editlist to correctly decode otherwise " + "a/v desync might occur\n"); + } /* adjust first dts according to edit list */ if ((empty_duration || start_time) && mov->time_scale > 0) { @@ -4507,10 +4512,13 @@ static int mov_read_trak(MOVContext *c, AVIOContext *pb, MOVAtom atom) * It cannot be used with use_mfra_for = {pts,dts} either, as the index * is not complete, but filled in as more trun atoms are read, as well. */ - if (!sc->stts_count || c->use_mfra_for != FF_MOV_FLAG_MFRA_AUTO) { - av_log(c->fc, AV_LOG_WARNING, "advanced_editlist does not work with fragmented " + if (!sc->stts_count || c->use_mfra_for != FF_MOV_FLAG_MFRA_AUTO && + c->advanced_editlist) { + + av_log(c->fc, AV_LOG_VERBOSE, "advanced_editlist does not work with fragmented " "MP4. disabling.\n"); c->advanced_editlist = 0; + c->advanced_editlist_autodisabled = 1; } mov_build_index(c, st);