From patchwork Thu Jan 16 04:49:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 17381 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 9FA0644A2E4 for ; Thu, 16 Jan 2020 06:56:52 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7D4C468B083; Thu, 16 Jan 2020 06:56:52 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ADCAE68ABF4 for ; Thu, 16 Jan 2020 06:56:45 +0200 (EET) Received: by mail-wr1-f66.google.com with SMTP id y17so17786288wrh.5 for ; Wed, 15 Jan 2020 20:56:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3+Ns+WzYRToh5hz9SPr8pa0kOlwTg63/ViE63jAxpKM=; b=AEfoOIo+wEKKBvs1/mqlM2hkxkXj+QzuEYtmXIsexVlodx563fx6Afww5lefIMZPZD D1lTyd94+vBS0VgoNNKCXCn7n0XJ891Jh6VRhhPofDPIUF5E1dQBYhy/I9yYCv7HO9wY veHZ/kWFwCp4VIfckdkDlyaevEYpgf3NghZ4gvTGTbBdb87XGCVes8DOXnv01tA0RKFy 5nhjiyu/kCem8BCFJGTqdgSdtm/vz7abz4JtZifLmH04a8MmxnTUIB4mtBV9+QBuIClC pt37m/f21jRl1XnApBQEh4fOpfMrgvrtd47ESY9RsE3raQQGgqmDwAGiXwfoDCIjW4qt nbfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3+Ns+WzYRToh5hz9SPr8pa0kOlwTg63/ViE63jAxpKM=; b=ci3tLDhWZQ46zY5kx8ifHV7SolfV28euwzjimbNxvm0pzl+DZPNcsr6k/jW23llPDW HJikxfTLj2ZUCNInEu0cJLzUpSquaW8bBNBekxr9o8Z+jXkrAV8s9dPmxvu1NwU3mAU1 C4wdItA3tOuVhbpP/vL/Q8CTlCkhH0ndsKVml/zt2CxTIGQt14A6vJ2P+xxIGdj36Thr yGPyQ/iMrjHMQJ3FlA5bENZA9SpLUctMzhqSOc/ceZdcyqxBujfUd4/LYuQtkQlGz2Vz NK/5iL7baI74Q4d5nJ8gzZtG5975ivjHdeZmKmuMHtQy/1WPXyNO9wrDc48DMt5GzecA ZS0Q== X-Gm-Message-State: APjAAAVFOCUrKZm+PHFlB6y0vQosabRjvTBO8aQ+FlpsnGeqzR26ANFe DyQYsbWmTiOXu1TCUTtw5dM4HIyS X-Google-Smtp-Source: APXvYqz4z0qE3mmPsCWYOquVbuaDsIVXdtJI5B83B/Z53ErZ/nzu3haiyCheWKmhuMjFoyFOuaD7VA== X-Received: by 2002:a05:6000:1044:: with SMTP id c4mr976754wrx.204.1579150169955; Wed, 15 Jan 2020 20:49:29 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc08bbf.dynamic.kabel-deutschland.de. [188.192.139.191]) by smtp.gmail.com with ESMTPSA id m7sm2289658wma.39.2020.01.15.20.49.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2020 20:49:29 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 16 Jan 2020 05:49:14 +0100 Message-Id: <20200116044915.13681-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] avformat/movenc, segafilmenc: Remove unnecessary avio_tell() 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" When the faststart option for the mov/mp4 muxer is used, the current position (i.e. the size of the already written data pre-shifting) was evaluated twice: First in an initialization and then again later, overwriting the first value without having ever touched it. So remove the initialization. Also, the clone of this code in the Sega FILM muxer behaves the same and has been treated the same. Signed-off-by: Andreas Rheinhardt --- libavformat/movenc.c | 2 +- libavformat/segafilmenc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index a2cfc59b89..282d14ab1a 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -6718,7 +6718,7 @@ static int shift_data(AVFormatContext *s) { int ret = 0, moov_size; MOVMuxContext *mov = s->priv_data; - int64_t pos, pos_end = avio_tell(s->pb); + int64_t pos, pos_end; uint8_t *buf, *read_buf[2]; int read_buf_id = 0; int read_size[2]; diff --git a/libavformat/segafilmenc.c b/libavformat/segafilmenc.c index 6b66c68328..93c482ef7d 100644 --- a/libavformat/segafilmenc.c +++ b/libavformat/segafilmenc.c @@ -209,7 +209,7 @@ static int film_init(AVFormatContext *format_context) static int shift_data(AVFormatContext *format_context, int64_t shift_size) { int ret = 0; - int64_t pos, pos_end = avio_tell(format_context->pb); + int64_t pos, pos_end; uint8_t *buf, *read_buf[2]; int read_buf_id = 0; int read_size[2];