From patchwork Tue Feb 28 14:31:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 2698 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.65.149 with SMTP id x21csp1477568vsf; Tue, 28 Feb 2017 06:31:46 -0800 (PST) X-Received: by 10.28.221.11 with SMTP id u11mr2704085wmg.75.1488292306018; Tue, 28 Feb 2017 06:31:46 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id y13si2696428wry.67.2017.02.28.06.31.45; Tue, 28 Feb 2017 06:31:45 -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 DAD5F6883E7; Tue, 28 Feb 2017 16:31:22 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe01-2.mx.upcmail.net (vie01a-qmta-pe01-2.mx.upcmail.net [62.179.121.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 004DD6883C5 for ; Tue, 28 Feb 2017 16:31:15 +0200 (EET) Received: from [172.31.218.39] (helo=vie01a-dmta-pe03-3.mx.upcmail.net) by vie01a-pqmta-pe01.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1ciioH-0002Pm-T7 for ffmpeg-devel@ffmpeg.org; Tue, 28 Feb 2017 15:31:25 +0100 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe03.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1ciioB-0000jC-Ur for ffmpeg-devel@ffmpeg.org; Tue, 28 Feb 2017 15:31:19 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id qEXC1u01b0S5wYM01EXDq0; Tue, 28 Feb 2017 15:31:13 +0100 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 28 Feb 2017 15:31:10 +0100 Message-Id: <20170228143112.13750-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.11.0 Subject: [FFmpeg-devel] [PATCH 1/3] avformat/oggdec: remove unused parameter of ogg_restore() 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Michael Niedermayer --- libavformat/oggdec.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c index e1ef21337c..64a88261e3 100644 --- a/libavformat/oggdec.c +++ b/libavformat/oggdec.c @@ -61,7 +61,7 @@ static const struct ogg_codec * const ogg_codecs[] = { static int64_t ogg_calc_pts(AVFormatContext *s, int idx, int64_t *dts); static int ogg_new_stream(AVFormatContext *s, uint32_t serial); -static int ogg_restore(AVFormatContext *s, int discard); +static int ogg_restore(AVFormatContext *s); //FIXME We could avoid some structure duplication static int ogg_save(AVFormatContext *s) @@ -95,12 +95,12 @@ static int ogg_save(AVFormatContext *s) ogg->state = ost; if (ret < 0) - ogg_restore(s, 0); + ogg_restore(s); return ret; } -static int ogg_restore(AVFormatContext *s, int discard) +static int ogg_restore(AVFormatContext *s) { struct ogg *ogg = s->priv_data; AVIOContext *bc = s->pb; @@ -112,8 +112,6 @@ static int ogg_restore(AVFormatContext *s, int discard) ogg->state = ost->next; - if (!discard) { - for (i = 0; i < ogg->nstreams; i++) av_freep(&ogg->streams[i].buf); @@ -128,7 +126,6 @@ static int ogg_restore(AVFormatContext *s, int discard) } else memcpy(ogg->streams, ost->streams, ost->nstreams * sizeof(*ogg->streams)); - } av_free(ost); @@ -631,7 +628,7 @@ static int ogg_get_length(AVFormatContext *s) } } - ogg_restore(s, 0); + ogg_restore(s); ret = ogg_save(s); if (ret < 0) @@ -654,7 +651,7 @@ static int ogg_get_length(AVFormatContext *s) streams_left--; } } - ogg_restore (s, 0); + ogg_restore (s); return 0; }