From patchwork Sun Jun 10 10:36:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 9346 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:11c:0:0:0:0:0 with SMTP id c28-v6csp2902794jad; Sun, 10 Jun 2018 03:37:49 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIu0z2y1R0MCoHoddii/I34Riuz69jq3oTX088b1u9DdIXRYKA07DeE2XGpW0i330C9xWgK X-Received: by 2002:adf:dd8c:: with SMTP id x12-v6mr10975875wrl.212.1528627069731; Sun, 10 Jun 2018 03:37:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528627069; cv=none; d=google.com; s=arc-20160816; b=am0W9q0Q6qxShoTaPti1J/L/7EdzwK7C4ZQcGvtG/BboHlUR32j7hgKStobrMjbu8x bybR9Iu/T2cndsfhqcfS+9SBrneOxV+GjU50MPQ1tAMpzCNcfo2sO62nm1o6kTpU3AcY VlaGmop6n0AfjhBMkO1kGbDdE5w2e0lacCC0E7gELY+xbQsAZL9f6+S9W1EySDi5XxWG K63L9i9XEKAeaiebxytmQweGbdzzkDPiVmDGF2wQFITFVlUS6qppW5d9uQws/JRTyfZ/ RTOhTDyb4Nd6joae3FicDNkngkFcThCTAuhfMPqM1Fv4O42rYEobs7rrXs5wLOb1LyT6 +tgA== 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=Ay7WMG1A8XnWxUcqgzqXBIyEG4unuZ2Xf4mt7p+sKR8=; b=Y11P1gzM85bJjEchoI9zT5Ym54pNvDuQ3wogyzZdx3UiGX7ErU03buW5zeCjAqEH1d P1usEg60K9+7uDXN0DRI934cQjvUh+1HbVQ/nfJBSwP9S62pmPiwwrSQg4tv7nU12o6p SjPf+NIvwo+/nR/gGX5xeNz9miLY+RURFsLLyZ+XR3rDugx5o4WECFC/0bine0WnIbND eX1sozn01QciAmWQjMRMBx8mhXEgP4owpeVJRzUxNSS1fGrQCxgIESlw/r5LItuDq05f 2bzG6/hDGJ3U9TgNdRa60YRuXOaOVv2zNifML6Xg2a0bdpdLe0dJb/j2VruAxIB2ZJLo Vh1Q== 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 k8-v6si11921426wrk.440.2018.06.10.03.37.49; Sun, 10 Jun 2018 03:37:49 -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; 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 AA74568AC99; Sun, 10 Jun 2018 13:36:23 +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 5D92868ABF1 for ; Sun, 10 Jun 2018 13:36:17 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 363D8E0F70; Sun, 10 Jun 2018 12:37:06 +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 XJgPbU2oShfi; Sun, 10 Jun 2018 12:37:05 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 3C4D3E0E49; Sun, 10 Jun 2018 12:37:05 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Sun, 10 Jun 2018 12:36:44 +0200 Message-Id: <20180610103650.10155-6-cus@passwd.hu> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180610103650.10155-1-cus@passwd.hu> References: <20180610103650.10155-1-cus@passwd.hu> Subject: [FFmpeg-devel] [PATCH 06/12] avformat/mxfdec: make current_edit_unit a parameter of mxf_compute_samples 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" No change in functionality. Signed-off-by: Marton Balint --- libavformat/mxfdec.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index be6884edbe..8e099164aa 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -3215,7 +3215,7 @@ static int64_t mxf_set_current_edit_unit(MXFContext *mxf, int64_t current_offset } static int mxf_compute_sample_count(MXFContext *mxf, int stream_index, - uint64_t *sample_count) + int64_t edit_unit, uint64_t *sample_count) { int i, total = 0, size = 0; AVStream *st = mxf->fc->streams[stream_index]; @@ -3229,7 +3229,7 @@ static int mxf_compute_sample_count(MXFContext *mxf, int stream_index, if (!spf) { int remainder = (sample_rate.num * time_base.num) % (time_base.den * sample_rate.den); - *sample_count = av_rescale_q(mxf->current_edit_unit, sample_rate, track->edit_rate); + *sample_count = av_rescale_q(edit_unit, sample_rate, track->edit_rate); if (remainder) av_log(mxf->fc, AV_LOG_WARNING, "seeking detected on stream #%d with time base (%d/%d) and " @@ -3246,8 +3246,8 @@ static int mxf_compute_sample_count(MXFContext *mxf, int stream_index, av_assert2(size); - *sample_count = (mxf->current_edit_unit / size) * (uint64_t)total; - for (i = 0; i < mxf->current_edit_unit % size; i++) { + *sample_count = (edit_unit / size) * (uint64_t)total; + for (i = 0; i < edit_unit % size; i++) { *sample_count += spf->samples_per_frame[i]; } @@ -3595,7 +3595,7 @@ static int mxf_read_seek(AVFormatContext *s, int stream_index, int64_t sample_ti cur_st->time_base); } else { uint64_t current_sample_count = 0; - ret = mxf_compute_sample_count(mxf, i, ¤t_sample_count); + ret = mxf_compute_sample_count(mxf, i, sample_time, ¤t_sample_count); if (ret < 0) return ret; cur_track->sample_count = current_sample_count;