From patchwork Thu Jun 30 06:42:31 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: 34761 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:8b27:b0:88:1bbf:7fd2 with SMTP id l39csp106590pzh; Wed, 29 Jun 2022 23:43:03 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vzNzMIoe2E3X2I1kC6cFyNqhWeoKKZ0XZWCrQzSkKr1en7y97QnYozXfpx8g4sKugKMK/X X-Received: by 2002:a05:6402:254c:b0:435:c541:fc8d with SMTP id l12-20020a056402254c00b00435c541fc8dmr9548313edb.385.1656571383195; Wed, 29 Jun 2022 23:43:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656571383; cv=none; d=google.com; s=arc-20160816; b=PsNDhjjslmYFiSpy7wBgkAPaFYtdkB7uEFpq49VZ9+JYnxDYxrjCR6qs+ZLqeM3MAk XH44S+q4CZzA0GmURaFAeuwcWiaEnvWQhlGryvqsOzWdJsiDkJyVhONABaNxBcUXkYh/ QcyyzLsigdimEPzWxgfUcOvl62Y/GdB7tqK07oThKWyCgSmD4eO/LQ0HO+2kXsObWZ2f OkEcbHkLSxU/gU8+MGbJVlLvYR3S6figCmJf1DV/5jOho1nCVObo48FE9Gn9Nq/cR9wz 776DAkFPUV9AMZtjQF0enHFN84carywHqeokDp129CFFyC3dciDFDzAini1boTbbPZbS nu4Q== 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=uCjf1NPVS9eHr+x351gZiROoG8n8dU2ymzZIoEQ3BXM=; b=SLQKIryYwhQ2I7qRNg2iHoyYevMtgx1wEpqcwjPHT4qPKBDwHoJY9RspIA8ewibSRe gzjQKJr/kQWKzRJyDyRB0hQywVJ8nO5zadjvJlMvUlKAAYxk58X9QXxYEl7pqtk/eBsq Itz/uqlY2yH537cBZ4AFA0cnsGcj6UpAIjZm8tr/DsF/Tp0rIGd6qXnhmAII0Z1KETAi sxVebhtZs9m5N/JPxlDrTCZSlo6i1gAOMbL372W+awLjxEWGfNNJHnpychoMLEZSz47r EcJEb5ly08DhNowN02RHn6RdAI3zNkEs07sg+K6AKfD0bppjj1ArzUwDFeDWMGC5phaJ xoYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=grr19vo9; 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 j12-20020a170906830c00b006f39e3cc855si5165769ejx.648.2022.06.29.23.42.56; Wed, 29 Jun 2022 23:43:03 -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=grr19vo9; 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 C700068B743; Thu, 30 Jun 2022 09:42:51 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9F53A68B609 for ; Thu, 30 Jun 2022 09:42:45 +0300 (EEST) Received: by mail-lj1-f174.google.com with SMTP id b19so9061983ljf.6 for ; Wed, 29 Jun 2022 23:42:45 -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=6BaXzQTBb6dgpc6Oz4Ideu5Y+FFvRtsMZ3ETdmeggrc=; b=grr19vo9dT8WXFNLeujj1NDwRHpIWfIArXXEw+tXdZ9Oaa3q9fOfDd9hnUdfW04lb7 CtvzdrADHSIYz047jFgrc6VAql0AYmKdjIS0oPm3X3iD3L4mQyPDNm8bnsY1quyyfnkI /ms4mGygDGqRJz1k+qR1fWhNtgHNqv/F7pAA0jt4TWnM9ii8wQOdiyNtW4DkW68MLIrO JksrjWDh3nfCB4HOn2jgHrer0M4qLu4LK+/NaX8HJeRau3ygNmXsfBrf48rJvMSduWEY rSs/bzmAPIXjm4/nAZ7hkv/qvu60qDXA1gGaRmldyMz6DUd1nPuDF+uYMveLi4PNbAId LDkQ== 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=6BaXzQTBb6dgpc6Oz4Ideu5Y+FFvRtsMZ3ETdmeggrc=; b=OrMsC17huPFm5h2jSQtFtt4RVdlD34v82wgJI9SeDIjE6o6CzlO0y7nduVqLbZZxLO JprPHo/aEE/xppHeJenqupIcDrq0jM0LjoH6rb1GXsWtuFtn73MyG83QHouHX5Yzi0WC blu/rDygMPOtOo1tIwjshPt6R659Nf3HrVWeQ+gTR98H0yjlDRD5d3wRsB1V8Dwv8RC/ 4ss524GHtFdf9fFKe17OoEBBDWsDdCr/jvGDSqYY9n5nLL9FD1Zp7j3QOQewDHNkwMAy abNMS7aGvUuOflU4c8MgroR3EgYZa6iNOdDsAQd8ZJt2v0bKAYTHjr2nshXfazb3ZeIJ TUMQ== X-Gm-Message-State: AJIora8lUmkG4cEe33GcEZ6VLI4Gx8qYfQg65XVOhY66WPFruL/+ceSO J5/dwj7tjW7RJegSY4E1MBupKSdIk0c= X-Received: by 2002:a2e:9d84:0:b0:25b:c7f1:c978 with SMTP id c4-20020a2e9d84000000b0025bc7f1c978mr4137263ljj.126.1656571364829; Wed, 29 Jun 2022 23:42:44 -0700 (PDT) Received: from localhost.localdomain (91-153-198-187.elisa-laajakaista.fi. [91.153.198.187]) by smtp.gmail.com with ESMTPSA id c17-20020a056512075100b00479112bb555sm2948091lfs.60.2022.06.29.23.42.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jun 2022 23:42:43 -0700 (PDT) From: =?utf-8?q?Jan_Ekstr=C3=B6m?= To: ffmpeg-devel@ffmpeg.org Date: Thu, 30 Jun 2022 09:42:31 +0300 Message-Id: <20220630064238.45315-1-jeebjp@gmail.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v5 0/7] 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: HyrInRH/RmxG 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. Difference to v4: * Reverted to v1 base (extending the avpriv) as it was preferred in review. * Reutilized the ac3_bit_rate_code variable in the parser instead of doing `frame_size_code>>1` again. * Added avcodec minor bump as it seems like we're heading towards the end here. Jan Jan Ekström (7): 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 avformat/movenc: limit ISOBMFF AC-3 mapping to bsids <=8 configure | 2 +- libavcodec/ac3_parser.c | 5 +- libavcodec/ac3_parser_internal.h | 1 + libavcodec/version.h | 2 +- libavformat/movenc.c | 131 +++++++++++++++++-------------- 5 files changed, 79 insertions(+), 62 deletions(-)