From patchwork Thu Aug 6 08:04:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xu, Guangxin" X-Patchwork-Id: 21512 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 9C336448957 for ; Thu, 6 Aug 2020 11:04:55 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 84B6468BAD4; Thu, 6 Aug 2020 11:04:55 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1F49C68BAB6 for ; Thu, 6 Aug 2020 11:04:48 +0300 (EEST) IronPort-SDR: 3Kq466BWlAu3T+QZGJdI9y2CT/jeuMCGMLYdgsi8XJZtG0dOA/4uQMEYxfyjyY8BydY8SjCriH iCWnsU5pU/rQ== X-IronPort-AV: E=McAfee;i="6000,8403,9704"; a="140349982" X-IronPort-AV: E=Sophos;i="5.75,441,1589266800"; d="scan'208";a="140349982" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2020 01:04:43 -0700 IronPort-SDR: 3Z5Q8bN9AfzedRrWtBUIsRgZupDDLm6nmVpbPsPIgmYjg+WsZGYos5WFlvrv7Su3Nombmebut6 8pBE5uF14/sQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,441,1589266800"; d="scan'208";a="493587712" Received: from skl-e5-server.sh.intel.com ([10.239.43.170]) by fmsmga005.fm.intel.com with ESMTP; 06 Aug 2020 01:04:42 -0700 From: Xu Guangxin To: ffmpeg-devel@ffmpeg.org, jamrial@gmail.com Date: Thu, 6 Aug 2020 16:04:14 +0800 Message-Id: <20200806080416.17691-4-guangxin.xu@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200806080416.17691-1-guangxin.xu@intel.com> References: <20200806080416.17691-1-guangxin.xu@intel.com> Subject: [FFmpeg-devel] [PATCH 3/5] avformat/av1dec: refact, do not overide return value in read_obu 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: Xu Guangxin MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" we need them later --- libavformat/av1dec.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/libavformat/av1dec.c b/libavformat/av1dec.c index 297e87cc52..ec66152e03 100644 --- a/libavformat/av1dec.c +++ b/libavformat/av1dec.c @@ -60,14 +60,9 @@ static int leb(AVIOContext *pb, uint32_t *len) { static int read_obu(const uint8_t *buf, int size, int64_t *obu_size, int *type, int *has_size_flag) { int start_pos, temporal_id, spatial_id; - int len; - len = parse_obu_header(buf, size, obu_size, &start_pos, + return parse_obu_header(buf, size, obu_size, &start_pos, type, &temporal_id, &spatial_id, has_size_flag); - if (len < 0) - return len; - - return 0; } static int annexb_probe(const AVProbeData *p) @@ -137,8 +132,8 @@ static int annexb_probe(const AVProbeData *p) break; } - temporal_unit_size -= obu_unit_size + ret; - frame_unit_size -= obu_unit_size + ret; + temporal_unit_size -= obu_unit_size; + frame_unit_size -= obu_unit_size; } while (frame_unit_size); return 0;