From patchwork Sat Feb 17 21:45:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 7625 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.150.1 with SMTP id c1csp2205777jai; Sat, 17 Feb 2018 13:46:01 -0800 (PST) X-Google-Smtp-Source: AH8x224CTGax6WWJAsMOQvWnrs1pOoip4lEZ/IKfQ5wiKK9ISlgiGORmPE0CHlnBor7MAX/chPG3 X-Received: by 10.223.169.110 with SMTP id u101mr9879937wrc.31.1518903961186; Sat, 17 Feb 2018 13:46:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518903961; cv=none; d=google.com; s=arc-20160816; b=JoINVcw6f+xoiEHH6hnPV5ebXVd+8lgOjZkeAYMQTR25Am+ModhD9tktui4UXKmD2q J2LFL+ztNEj4dNBpjXBW/LhifYKWVOECKS0Tcjn5zAHtASaMev6m6OssiipugvzlgYpk 63OQ9D475yoDlLb633+7wEmPtjNjXIXzx2x9jSt43DkJIUET01+ao7sq0Uf9Vp0zT4KF KQIHe3Ytfx+vvt5cTAtLD1HWjbSbPbAxJIyjfbY9weGFFPSY03CLBM4FP34df3hvJj14 dlTqLh89DbCit/VayC6GV3+pQLYeT4ogEFgC9KpYWUVIV45FOarTfv1DqmHNmGamHjob 62GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=1FWyPC48FP3G0oyWAuo7rJNTa2Iu4MUt1gq9YeH5W7w=; b=ZTLexefamu9hu9PC2I6s8nxLwZb0HJHKGf3H/5knDnNR5gmTwII2mc/lu4SZYb9U5n z4GXx1CiVlEJC+Vu9s5BG+G+d/9ZaKdc5fh83mgvbu+G/Ya0wviToEBqyUyVxHlPqa/D w9QUIZluCVzYljbci7vs5WM9S/hv1h6ogmGt6NFPQTHCdZ4CzS1xHWGuBCDxkKJBkqRe 5ZWCJlS5S263N+35DHETXxqiiyiP48VW+0pKa48xd001PHAPH6O9p9V2zFqNQdbvyCOd ResYHne7NKFUlIcrd6xerYzt2K1HfbV8tE5XgQsHlG3wtQcCsKd/9SuhELh+cmO6aplV Hwhg== 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 k28si10929465wre.465.2018.02.17.13.46.00; Sat, 17 Feb 2018 13:46:01 -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 E00AF689C6F; Sat, 17 Feb 2018 23:45:51 +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 56407689B4B for ; Sat, 17 Feb 2018 23:45:45 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 63F56E1643; Sat, 17 Feb 2018 22:45:45 +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 wdss9QYd2rXS; Sat, 17 Feb 2018 22:45:44 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id AB4F7E1949; Sat, 17 Feb 2018 22:45:44 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Sat, 17 Feb 2018 22:45:30 +0100 Message-Id: <20180217214538.24255-2-cus@passwd.hu> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180217214538.24255-1-cus@passwd.hu> References: <20180217214538.24255-1-cus@passwd.hu> Subject: [FFmpeg-devel] [PATCH 02/10] avformat/mxfdec: fix essence_offset calculation X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" The reference point for a KAG is the first byte of the key of a Partition Pack. Fixes ticket #2817. Fixes ticket #5317. Signed-off-by: Marton Balint --- libavformat/mxfdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index fcae863ef4..95767ccba4 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -2875,8 +2875,8 @@ static int mxf_read_header(AVFormatContext *s) * for OPAtom we still need the actual essence_offset though (the KL's length can vary) */ int64_t op1a_essence_offset = - round_to_kag(mxf->current_partition->this_partition + - mxf->current_partition->pack_length, mxf->current_partition->kag_size) + + mxf->current_partition->this_partition + + round_to_kag(mxf->current_partition->pack_length, mxf->current_partition->kag_size) + round_to_kag(mxf->current_partition->header_byte_count, mxf->current_partition->kag_size) + round_to_kag(mxf->current_partition->index_byte_count, mxf->current_partition->kag_size);