From patchwork Wed Dec 28 03:19:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 39799 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bc95:b0:ad:ade2:bfd2 with SMTP id fx21csp3859477pzb; Tue, 27 Dec 2022 19:20:24 -0800 (PST) X-Google-Smtp-Source: AMrXdXus+iSlLSYpC7zHju687N6SIagVGARC3byQq0RHLk7x6ZnFTRtD5kRccyx1haLfM97IIpMw X-Received: by 2002:aa7:c709:0:b0:46c:d5e8:2fc9 with SMTP id i9-20020aa7c709000000b0046cd5e82fc9mr20125121edq.13.1672197624343; Tue, 27 Dec 2022 19:20:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672197624; cv=none; d=google.com; s=arc-20160816; b=e/01XwrW6susXlPgjuN7yad4LCZZHHmBqrodTRVIq/ZkP0CByvbNp3B3qWRTzz4qOf eJOhlM+SkyfW6mj/Zr1MYGX9kBknvhcWIg5NJSA/BCi4La3P2lLi2HI9RYVrH4Mw476c YROGYM20FXNeEk848/jYX5msOz/piQ4J5HaAOQ4jzNSYC2f+N1SSYG3qdms0d7F25BzE WLQ8b8MnNvoqjE4VYRstWY8uUrOmEb8iP+7k4hzlnJjs0EdDw70o2fOAVVlgBjG0tsA2 4L9gn2WPCK4wNq4vuxJoMwWW0VLggCYOK8q5UOVbpqgNLZph+ZjXQGAbzcWFn0BUz7s9 Y67w== 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:references:in-reply-to :message-id:date:to:from:delivered-to; bh=5zemUIbnlOgnyZ/4xhbwiXSrHOHb1mKy7O35UKay97U=; b=l386uyPNHTMFuEdgoL4QP++ClHGvG0dEE+Fb3JZfRVNuBM/gMlkwEliDDY4RCeY1t2 h2jHdl6yTZTkWZLany/eCtQuTVw6FypEmFlYi1NiZHdCLrpPOj/A9obxegZ4fWpY0kvg 9tUstYD1hN7IIDwPpRrik4dpIjmqedkf2WrOe47QEKOfcTU1pkqUkAJpGFbIiuw3LjgP htJYaPiwLP4nJmvm35DEl9AJeqNanczjtb8WMxNwHVAkK4FGEPB/0l/FFO76Y4xGDoPO LTzC7/TxSebnLBoU4iYMWKMTUN6MbT3UwUxN5aUEzNkjP9KhULz1y7RDjpVXJAqoOA1i EEsg== ARC-Authentication-Results: i=1; mx.google.com; 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 dp18-20020a170906c15200b007e08e2619e7si12767651ejc.860.2022.12.27.19.20.24; Tue, 27 Dec 2022 19:20:24 -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; 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 50C0D68B7FA; Wed, 28 Dec 2022 05:20:12 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D711368BC0F for ; Wed, 28 Dec 2022 05:20:05 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 51AE9E8410; Wed, 28 Dec 2022 04:20:04 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HgddK4zyLgbX; Wed, 28 Dec 2022 04:20:03 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 25699E82F8; Wed, 28 Dec 2022 04:20:03 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Wed, 28 Dec 2022 04:19:57 +0100 Message-Id: <20221228031958.26570-2-cus@passwd.hu> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20221228031958.26570-1-cus@passwd.hu> References: <76674b9a-30ff-a43-6d51-8c74dca8fa@passwd.hu> <20221228031958.26570-1-cus@passwd.hu> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/3] avformat/mxfdec: support Avid files with an extra index entry 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: Marton Balint Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: +rbmoojxGYUL Signed-off-by: Marton Balint --- libavformat/mxfdec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index ad4ee15570..2e61e77d67 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -1991,11 +1991,11 @@ static int mxf_compute_ptses_fake_index(MXFContext *mxf, MXFIndexTable *index_ta int index_delta = 1; int n = s->nb_index_entries; - if (s->nb_index_entries == 2 * s->index_duration + 1) { + if (s->nb_index_entries == 2 * s->index_duration + 1) index_delta = 2; /* Avid index */ - /* ignore the last entry - it's the size of the essence container */ + if (s->nb_index_entries == index_delta * s->index_duration + 1) + /* ignore the last entry - it's the size of the essence container in Avid */ n--; - } for (j = 0; j < n; j += index_delta, x++) { int offset = s->temporal_offset_entries[j] / index_delta;