From patchwork Mon Jun 5 18:30:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kucera X-Patchwork-Id: 3847 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.10.2 with SMTP id 2csp1487704vsk; Mon, 5 Jun 2017 11:36:02 -0700 (PDT) X-Received: by 10.28.7.16 with SMTP id 16mr9033692wmh.16.1496687762656; Mon, 05 Jun 2017 11:36:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496687762; cv=none; d=google.com; s=arc-20160816; b=m0/0NT7lLjtslWEDtI7irg1ELIqx/b3Gn+zmgVvi/OiGQqOsyOzFerR6sMi0CvrgNf 6CmRKues2y0EQk2dO1gc893xCZEBGVcci3xRgICvIj3W081fQvTEdatjzA/k4wG4ypJx v0u0fz+B9U/xAmLTNbXEHenky7AK5pdKxFONDS4qXr+TY2WYJeSNDAzjA8/AQOy/AQBR YHx5vuUiKHNRk9ZfR+EsQM6ikiEgI2NqZkOLOeze5GqsgsC5pYwYmpkVOBqPSOT34gsP N8Th6DQD0SIrtTRKZU7uYAzeHElCfQyXDBr1tTwb61fID0pMHgfHqFw6UuM2TrILFijH uuNg== 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:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=feJ5nUuuvBRFdcyh7WXIAiFGHRQXE3L4+jQoNKErWK0=; b=akxctiyiHLnOIMtgMacHeDLz65uPMaSUzZUrNUah4xUsnqiNfPbI18q5RZcgV3VJS4 J6fj/24wjt4eWCyr6QKzBRF4lgO/FMRSftg6+9gdVJXMZ/9NWXI+2lZbF5nBP45X/nw6 EG05oTWQbvQb1ytarIdkjUfWCj17pcqkJEkftagzLtcFuS3BW/wVPHyERTE1gvA1bSED CEodZgXtKXGYCvJFTmUCHYJB2KJcTd/RbqNIZUcxus5NWezK150yqfxtMaQa8IC72Xjx /ONz6XohsygKXTVMcGihOmf0ooGgi6XkGWloRknp9QAW11F1SUmqfOlGg02eSamMNdzO DgGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id l33si22504252wrc.111.2017.06.05.11.36.02; Mon, 05 Jun 2017 11:36:02 -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; dkim=neutral (body hash did not verify) header.i=@gmail.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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1F464689DAC; Mon, 5 Jun 2017 21:35:53 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C0F80689D75 for ; Mon, 5 Jun 2017 21:35:46 +0300 (EEST) Received: by mail-wr0-f194.google.com with SMTP id g76so8221052wrd.2 for ; Mon, 05 Jun 2017 11:35:53 -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; bh=/yGq4chs07eNxvl0J4TH4xB6G+t1rnIG0MnKtuBlgKA=; b=kz8XtmFPSOlHhl50ItTxBpy22w8AUW1HmUN2sZe7aTaJ5Yi+v1b8wvjOzCS31hwcAo QqSxdvX3+1g/izPQKz1bh77Y3RyZQHYAQqIktxzwvLp8sIvsfUD9AaadSsqopl0+ZqOC X2SPmF3nRetfD1SC1U8ZJfNgW91t0rnOMx4+IgeOkoKJRmxmP3yMMUQeAXtXUob6VjL5 fNuuEC5DJdyQjLbxwaQSzTHotB2DGGHXYgvcN2I0Rkv7BOpms4npv+YDeXCVOGwnBfZv SCnQ5r5dKb+vCD35LNru9FN8+m6ziAJOV19F0pVcPgjR6q8/Ruc/IbgE4ifpxcZdyhJk OYRA== 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; bh=/yGq4chs07eNxvl0J4TH4xB6G+t1rnIG0MnKtuBlgKA=; b=gGINo2tnk0elSVb7ldnsYL5KHZRGIK+woPNNZyzUFKXREunJuVyhLifzjPuIEATJA3 HVnEI87PWHvtGAfI0XDdEWCzdbofV/Czdx59o+/cRBXmCRybA3kytXCg0jFTfRsjIul2 23iydjMMj1aoMYiSnWO3bo+xys2l3H/KXHxH1Omprqbri36QUQUr9Scuj+uowsj6R7dw oOBnzZzSSHzQA8+qRTEn5ntBRFsJucA1B8l/VMi3NUuyYLeyqF1pSFjl8xaXphDqo9uo hkKmTvkiM1OUjJ6JRytRXIxkmchoYzFqQ4uVNQ1DCF5OIp4Xg8SurOB0jSJZucnmMym8 y68A== X-Gm-Message-State: AODbwcDSJALxK2AYDqa0J647OH8g06yjshAP+nsGSlf47gXRJxnPO0l9 gGixTkxIQQweXobk X-Received: by 10.223.178.168 with SMTP id g37mr13945971wrd.158.1496687424806; Mon, 05 Jun 2017 11:30:24 -0700 (PDT) Received: from localhost.localdomain (ip-89-177-134-12.net.upcbroadband.cz. [89.177.134.12]) by smtp.gmail.com with ESMTPSA id o200sm11812618wmg.22.2017.06.05.11.30.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Jun 2017 11:30:23 -0700 (PDT) From: Daniel Kucera To: ffmpeg-devel@ffmpeg.org Date: Mon, 5 Jun 2017 20:30:16 +0200 Message-Id: <20170605183016.18669-1-daniel.kucera@gmail.com> X-Mailer: git-send-email 2.11.0 Subject: [FFmpeg-devel] [PATCH] libavformat/file: return AVERROR_EOF on EOF 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: Daniel Kucera MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Daniel Kucera --- libavformat/file.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavformat/file.c b/libavformat/file.c index 264542a36a..1fb83851c0 100644 --- a/libavformat/file.c +++ b/libavformat/file.c @@ -112,6 +112,8 @@ static int file_read(URLContext *h, unsigned char *buf, int size) ret = read(c->fd, buf, size); if (ret == 0 && c->follow) return AVERROR(EAGAIN); + if (ret == 0) + return AVERROR_EOF; return (ret == -1) ? AVERROR(errno) : ret; }