From patchwork Fri Jun 3 12:46:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jan_Ekstr=C3=B6m?= X-Patchwork-Id: 34744 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:6914:b0:82:6b11:2509 with SMTP id q20csp4604304pzj; Fri, 3 Jun 2022 05:46:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzabIfmHgYEXxMdKiPGGeggBiira+KRE/ZRTFrMvlR/QRJ6zHL1jT8xNjMwZi10QfsmSXsa X-Received: by 2002:a17:907:6090:b0:6fa:14ca:fba2 with SMTP id ht16-20020a170907609000b006fa14cafba2mr8621923ejc.564.1654260399380; Fri, 03 Jun 2022 05:46:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654260399; cv=none; d=google.com; s=arc-20160816; b=NBS+ypfLPj6t6BwSb2l4lsD77yrARKLSghZjxhrA5JLFfyFMGuDXIGTpepnM3OZGpA JWaWgH+IB2CM/iHzIK7efy7vohuH0ZQSvp/+eB+lD07BK0Q8nVSyqQC0DbIfBskylAY6 Ci5Y6x4Cv2sNWhRQaEmw/FLgVMyZR0XJcytQqkODhibCUeDLOEuQqlXyfQAQsUKPJn++ jGKxzKcEXkGpvDdBw+8WA7oo9AwwGLph9HxEjjrZ4gslcbH7eZ/CRXCzPlWpovMYZGVl pZmLGlCVTlBPJGuGKYFO20DGTggJv/3a4ZcncdDEMzVNn/fugBSdCUCCzafu4Pu6pvza Agag== 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=SY7p1a2Fk8mU1Vu8hiYDitvmwrG/3B/i14+zQC2fZbs=; b=xHaQ15MUdZEmTDbTzz815B1qgiXI2SrRHkos8c/6xrOw1euaxF8T4gH0rGpRdl6Iaq 28Irdps9aIvA58RiDfQMw7ByUJ9LiiIQL5qE/bFLM/CazbLyWemDqTJoluCEFWuX/2fV ogXWso5a8Owa8nbpdG9Ik0duBFYIEBFLpYZdfyU7vzAD9G+Wy5pqR0yA/zSBBMhKnJsf 89SDXd4SwS5ZtRmx11GkBRDl0qkuZ+6BjjiOAvSqzWFALh56dinQ5pdCcXao8IFjAgg4 H2dp2gdK29iFnpVJW2FkTWEhRBSlL+MT6sjtTyU0rxrFS2JwWSIN0aoE/GFR1t4w+UMR BF4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=D7o6BrUm; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id iy2-20020a170907818200b006f3916bcfc8si2666235ejc.142.2022.06.03.05.46.37; Fri, 03 Jun 2022 05:46:39 -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=@gmail.com header.s=20210112 header.b=D7o6BrUm; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9892268B642; Fri, 3 Jun 2022 15:46:33 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CF0F568B722 for ; Fri, 3 Jun 2022 15:46:26 +0300 (EEST) Received: by mail-lf1-f42.google.com with SMTP id u26so11718078lfd.8 for ; Fri, 03 Jun 2022 05:46:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=PqR1E05DM8jNhNZw91QEbzy/hd23AIHPOrMPzg/gvkk=; b=D7o6BrUm7UkoD0ywEWnKryNiPIw+fM7uyag/x9Tk9naND/LqULp49L6XIUX88W8S+c XZPb8lkuI0zg8AM6jMi+s3QosZe1xexWo3qld6SYpdikpgya5sjrtm7jD6A0EfDWRtTV XMuOcYZBSDoWgcHmltY+IgqSGm0SykQak+1RMnHR+/PG8EnxAusgL2Xu8R73tgA7D+6z TCpo/+pv9EuZTjcC8/yDa/vdMNrOiustlJ6l1MJOAFM5hVm5kqPbiRyiGhYpNeW2PbDI E/V8T60495jW3oS+vQgvoF/PApwC3BR/f0sGeiW4oforP73K2NG+mZD4MdcxI/uem0Cz 129Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=PqR1E05DM8jNhNZw91QEbzy/hd23AIHPOrMPzg/gvkk=; b=aoC+iVQ+IMdy9TA8EjeWZKRE/xjCNEHjrjJ5beVnnRn+4COuFNNoxOVnjffdQXAVUp cBZS0s5O8m+0NUTadoeS5SONgIXmZWTbKE4IhjLuxkyW8cfMxMP/rrc9pYyPRjZjia1y cLOFOccVc8WIqwXYRnfiIkCQagNCnT1KeH2yQX85Cwl5V78RgbqG4FuAgOg46cJIJnMc 6veNgm4MJu6O0oUeYDOAIUHeaLxGuaRe6qLfCQ38tEFQYBhp/rRfAJ1Y0xQ2Vv4i0Llt rR83xQ3uGIGmYD7gofRyNAMl5+yIMPcVYlSqIbscqMWCXDHi0mIkf3EE1cfzs1S1KbqY LZmw== X-Gm-Message-State: AOAM531QDm2XLGO+EQddYLDf3fmaKTlluQeXHA3I+QiDVX5wYrjTz7DT lf1LlaZcPXuzXD2zTNLq/uhuD2M04RE= X-Received: by 2002:a05:6512:515:b0:479:11a0:8132 with SMTP id o21-20020a056512051500b0047911a08132mr4955830lfb.344.1654260386094; Fri, 03 Jun 2022 05:46:26 -0700 (PDT) Received: from localhost.localdomain (91-153-198-187.elisa-laajakaista.fi. [91.153.198.187]) by smtp.gmail.com with ESMTPSA id m4-20020a0565120a8400b00477b624c0a8sm1561081lfu.180.2022.06.03.05.46.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 05:46:25 -0700 (PDT) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Fri, 3 Jun 2022 15:46:14 +0300 Message-Id: <20220603124620.15099-1-jeebjp@gmail.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 0/6] avformat/movenc: normalize on AC-3 parser usage 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: eaDwYxzi9N3h The simplified parsing currently in `mov_write_ac3_tag` trusts the content of the packets a bit too much (the AC-3 parser returns all data fed to it, including any possible data before the start code), while the existing E-AC-3 logic does proper header validation by utilizing the (E-)AC-3 parser. Thus, normalize on AC-3 parser usage for both AC-3 and E-AC-3. Jan Ekström (6): avcodec/ac3_parser{,_internal}: expose AC-3 bit_rate_code {configure,avformat/movenc}: enable AC-3 parser for movenc avformat/movenc: enable handle_eac3 to handle AC-3 tracks avformat/movenc: move eac3_info definition so that it can be used for AC-3 avformat/movenc: utilize existing AC-3 parsing workflow for AC-3 avformat/movenc: handle OOM situations when parsing AC-3 headers configure | 2 +- libavcodec/ac3_parser.c | 3 + libavcodec/ac3_parser_internal.h | 1 + libavformat/movenc.c | 123 ++++++++++++++++--------------- 4 files changed, 69 insertions(+), 60 deletions(-)