From patchwork Thu Apr 11 23:09:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 12703 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 9624B4485E4 for ; Fri, 12 Apr 2019 02:09:41 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 80C9768AE37; Fri, 12 Apr 2019 02:09:41 +0300 (EEST) 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 028BB68AE2A for ; Fri, 12 Apr 2019 02:09:36 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id E353DE224E; Fri, 12 Apr 2019 01:09:35 +0200 (CEST) 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 6ko3wzkmLH7A; Fri, 12 Apr 2019 01:09:35 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id DFFD3E2244; Fri, 12 Apr 2019 01:09:34 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Fri, 12 Apr 2019 01:09:19 +0200 Message-Id: <20190411230920.6630-4-cus@passwd.hu> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190411230920.6630-1-cus@passwd.hu> References: <20190411230920.6630-1-cus@passwd.hu> Subject: [FFmpeg-devel] [PATCH 4/5] avformat/mxfdec: take into account run-in in find_partition_by_offset 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" Signed-off-by: Marton Balint --- libavformat/mxfdec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 236294880e..6f0f87763d 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -433,15 +433,15 @@ static int find_body_sid_by_offset(MXFContext *mxf, int64_t offset) { // we look for partition where the offset is placed int a, b, m; - int64_t this_partition; + int64_t pack_ofs; a = -1; b = mxf->partitions_count; while (b - a > 1) { - m = (a + b) >> 1; - this_partition = mxf->partitions[m].this_partition; - if (this_partition <= offset) + m = (a + b) >> 1; + pack_ofs = mxf->partitions[m].pack_ofs; + if (pack_ofs <= offset) a = m; else b = m;