From patchwork Wed Sep 11 08:15:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: martin schitter X-Patchwork-Id: 51504 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:14c:b0:48e:c0f8:d0de with SMTP id h12csp137569vqi; Wed, 11 Sep 2024 00:10:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXRR73G1W0S25gS9TEeXELpCfhG2oEtYL1do5kvB/wa2koIaFW0woUpAUquueyPx4VP7YYXgmtFDmTf9TWJqrnw@gmail.com X-Google-Smtp-Source: AGHT+IF91kr5+KmOsT5i+jkhW9XoTi8KU4zpvkBTigZKaFDpgdqy8gTvSeIxQ0oIVfk4ydRxhJZy X-Received: by 2002:a50:cbc3:0:b0:5c2:60ac:fdd8 with SMTP id 4fb4d7f45d1cf-5c3dc78ec1fmr9961002a12.13.1726038611446; Wed, 11 Sep 2024 00:10:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1726038611; cv=none; d=google.com; s=arc-20240605; b=HcNIw1/u5psb1XLEU1PxJW3vu+1ncXHKnsjVlI8BBx553ucu1kHAUQNXw5oJKKW7f1 6eopRJ0eegZlqfVcOL3vz+igeWV87R/mVzXeiwUNOy1EaZ9yhwOiuoMgvWOguqDeeHRs MVXnpF/Jg9shMK5PuMfKZtb0CTlgdtdMSwhzhgr9IbwwjuCLGMVPpVeGTQYpwGxU3nqR M6J09mkK8K+Qxt8XaZ1JVEi/RsjOT94mgHRzaoQZ8UBi+ND8K9poSXKZ8GKLUtTF+Y4k LzbiR45hdMwzMnKeCJQCE+QMSw/iJSaBkAbj+nRb42HSGgaNUdrDUrfTm21B7uuxSKw7 Qj0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=gqcgOnkBjoctgndluuEFZRUABYMehQA8kgoAXEoaGLo=; fh=igg3JDwkSkAbPTwY6V0OsEq0RUkG4DKWC8fVJg4GhMY=; b=R38ZajNz7mUsQDhYzXm6s41SorBTA2xg8JwDUnREyFnUeLsUeIVKdact8DLVX2j7Je j+wbGTpbrQwLYKtSOsSHSiRh2beoUyYBtAFmSFl+LddX4mOlpe7jzdz2nQ8EovtnVuac jk5QGerTWwrsHrUHyOclexSlj2XlSnIXYcuVsnJ97olaEhGohMmFoBcmAeN4KqTZ5bKP l5rB2SjCNEDPKmy2W4Dt9mSZyZWHc7NlPDmcdbb/73N768hdPdVrgeJA7emMqJZx2lan dDqfWBp4zqnCZewwmG53UGIlwXhOGxk5bmtY+pJ8P6vqbg+S3pTs1DFwtjVBk5DiTqHL QkiA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@mur.at header.s=dkim2 header.b=N6YAhYC+; 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=NONE dis=NONE) header.from=mur.at Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 4fb4d7f45d1cf-5c3ebdb7572si6517122a12.671.2024.09.11.00.10.10; Wed, 11 Sep 2024 00:10:11 -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=@mur.at header.s=dkim2 header.b=N6YAhYC+; 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=NONE dis=NONE) header.from=mur.at Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6E9CD68DF93; Wed, 11 Sep 2024 10:10:07 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from efeu.mur.at (efeu.mur.at [89.106.208.42]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DA1B868DF93 for ; Wed, 11 Sep 2024 10:09:59 +0300 (EEST) Received: from localhost.localdomain (lan1.raspi.ma39.ffgraz.net [10.12.1.243]) by efeu.mur.at (Postfix) with ESMTPSA id BA79046252; Wed, 11 Sep 2024 09:09:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mur.at; s=dkim2; t=1726038598; bh=GNzwJcchB63oMPzW28//+SCy1BZCZnJxqDNSoystsPo=; h=From:To:Cc:Subject:Date:From; b=N6YAhYC+VIFt1I/yW6q3aN8EnZvKbuJ877tTRyTZ97s3ZRpPtCb4TZw51zndpPU5q ptm1Gasi01KMyNXwW1+lXU9nEJ5Fi2TToO0nZrx3MO3afyV8EMPs7IU+tAZ7kyWKgn YCgsz/iRCXXQfiB1/6ovZT20TheENUC9zXgLrNNvRijB56onqyeO6h5kJTWOTYoKj0 vshKtewhxP1k5FLdvmfF+QQPdGqb96U5ONk7C+9td7Jw2PlnhDXGVXOwXDeNDflmBe 1l41a0qfO589uj/X82oJl0jD+kwstHkWJhOho2PnaqaxYUxuZQJ8Og2BlyrdtIn6S1 lWy5Uf3AMosp3thEWTeJ6QphOuKGjQSumYT8Kz7TFjydp4HBjBagpq6FbftneM0iry H8IEkCe2pDvQLpClVMVwONxOtvq5GxYamYpWDBLvp9rAyXqnWbbmmR44HdPyHpiya8 o4twG2hY8dBv471TTnRdz8aMnqcBIVEKN4Pf7FlIKuSCRwLSyot From: Martin Schitter To: ffmpeg-devel@ffmpeg.org Date: Wed, 11 Sep 2024 10:15:11 +0200 Message-ID: <20240911081510.827899-2-ms+git@mur.at> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] libavformat/mxfdec.c: Recognize and Ignore MXF fill boxes 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: Martin Schitter Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 06uGQHqbKXxe This adds support for empty 'fill' boxes while decoding MXF files. --- libavformat/mxfdec.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 142b3e6..701fc9f 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -367,6 +367,8 @@ static const uint8_t mxf_mca_rfc5646_spoken_language[] = { 0x06,0x0e,0x2b,0x static const uint8_t mxf_sub_descriptor[] = { 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x09,0x06,0x01,0x01,0x04,0x06,0x10,0x00,0x00 }; +static const uint8_t mxf_fill_key[] = { 0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x03,0x01,0x02,0x10,0x01,0x00,0x00,0x00 }; + static const uint8_t mxf_mastering_display_prefix[13] = { FF_MXF_MasteringDisplay_PREFIX }; static const uint8_t mxf_mastering_display_uls[4][16] = { FF_MXF_MasteringDisplayPrimaries, @@ -3730,6 +3732,11 @@ static int mxf_read_header(AVFormatContext *s) continue; } + if (IS_KLV_KEY(klv.key, mxf_fill_key)){ + avio_skip(s->pb, klv.length); + continue; + } + PRINT_KEY(s, "read header", klv.key); av_log(s, AV_LOG_TRACE, "size %"PRIu64" offset %#"PRIx64"\n", klv.length, klv.offset); if (mxf_match_uid(klv.key, mxf_encrypted_triplet_key, sizeof(mxf_encrypted_triplet_key)) ||