From patchwork Tue May 14 08:49:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 13103 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 5273A449A2F for ; Tue, 14 May 2019 11:56:18 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2643D689985; Tue, 14 May 2019 11:56:18 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2D901680983 for ; Tue, 14 May 2019 11:56:11 +0300 (EEST) Received: by mail-wm1-f65.google.com with SMTP id q15so1937832wmj.0 for ; Tue, 14 May 2019 01:56:11 -0700 (PDT) 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=HuQXD/IUsnYF4DaXsWVNpq5NhVYXxcOXcyfs19GE2hI=; b=XBWXnzB4cLDZur/mUufr3WHmNan2iQLA0pCQBTXHvViZ/vtz8y1A9llGtZQrRtWlCW s0s9Dm6k3O7/pRUBzVwPvoHCL64/9iYc7STBU0x37HdGqWbQJ5P6eYNx5JFj8UToI22F ttjWmfULfKX+aj0UcLIRHU3u+NAWjgoNhFORHyhHY3jjdpdGIPvFufj7H1q/yT6mgozl gQWn9eYIMFhRFDtYeP21GlzdxNKODvJTF8XRyOm6X5WqPL24lPZRKFLXdRiKUskwMnrd +a9gN1BgwYY3715vj8Sc//Dai4oFgdgUGdKWXWgmRLx8fGxdauCDJQnU+ulfm5OGTia5 PBlQ== 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=HuQXD/IUsnYF4DaXsWVNpq5NhVYXxcOXcyfs19GE2hI=; b=l1YpFw3TlQ5iEIIx+iDv/hTm6JT4j/cqDMGNK5DTXSEWPWeyNUA82Y2a8rYFqwqL7i urPfEdJ2bNrMyIZn2P4ZuusEAS3MiEokdivw0dK4bvCclymqLTYhMkV+CaS3kpvzJCqa ezt9TikFJchuvocmdE/ON2cHSVmun4bEFtMPzo8rOmhYHD3HbfwiYZ6yOdh5VMCKM3+G aYrrSguwQIlK3feGLGXgjXRJyj5joidxTimN/uwX7hlamQUyVRroG97lx3q4YcnJm+i1 CAR6zrdQwoognX1zV4GUa8hu+Qz09zKAhcbWhHfuDxPY2O85DCHRp9/Ffy7SxylC2Aqf dP7A== X-Gm-Message-State: APjAAAUbQ05vXf6I9Lasg3obuGvOxNaFqBa4dgXjDrsGYqhV/2drycsL kEmJAFjZ0wiIsDi6riIXwidYuP2N X-Google-Smtp-Source: APXvYqwHVPExK1YIS7eGOH3YgaCDtGdouv6RLY5VfT41c7SuSsUiyrfUCHGmPy5UBbNSVwdVwAzObg== X-Received: by 2002:a05:600c:22c5:: with SMTP id 5mr17687004wmg.129.1557823847594; Tue, 14 May 2019 01:50:47 -0700 (PDT) Received: from localhost.localdomain (ipbcc18715.dynamic.kabel-deutschland.de. [188.193.135.21]) by smtp.gmail.com with ESMTPSA id x5sm15809901wrt.72.2019.05.14.01.50.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 May 2019 01:50:47 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 14 May 2019 10:49:48 +0200 Message-Id: <20190514084949.57498-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] avformat/aviobuf: Remove dead check 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" avio_seek only accepts SEEK_CUR and SEEK_SET (possibly OR'ed with AVSEEK_FORCE) as whence parameter. Therefore the check "whence != SEEK_END || force" is always true and can be removed. Signed-off-by: Andreas Rheinhardt --- libavformat/aviobuf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 5a33f82950..5c01423a2e 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -290,8 +290,7 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence) } else if ((!(s->seekable & AVIO_SEEKABLE_NORMAL) || offset1 <= buffer_size + short_seek) && !s->write_flag && offset1 >= 0 && - (!s->direct || !s->seek) && - (whence != SEEK_END || force)) { + (!s->direct || !s->seek)) { while(s->pos < offset && !s->eof_reached) fill_buffer(s); if (s->eof_reached)