From patchwork Fri Oct 27 18:46:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 5723 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.90 with SMTP id m26csp1033896jah; Fri, 27 Oct 2017 11:46:39 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TCbonpUdbUvYZn/3avA40PfYRlrjmHJwHOPnQXLD6jTNFYETEBUl6m/4JU37VgvBpvVF9i X-Received: by 10.223.133.214 with SMTP id 22mr1218635wru.23.1509129999216; Fri, 27 Oct 2017 11:46:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509129999; cv=none; d=google.com; s=arc-20160816; b=emHOWIfzf+ba6oiN0MybGc22KYcpl42JrDGw92O3A+r4PZtj5JKbV/z7ZPxIyhmbfX eFic7UMkDVNz2rtxf9FV6jMHE8G1GYfnkLsxxIpUND87IevPB8BswsDTg2AiileRcfXL n7BQNzXLiW9i0Fj/+bBY78JmHQJmxxUEiYaecBH5gvHRz80bfCX3LkYlfNVR2BAH7iKa Np3nhafJkp1pM8GCNwwA4EnJyg9LeYBmp7xRNdzp7fZVvXjFGN6WPvioKrqFw3IcPACS epfarVG6ns2NOHVKavi7U1cIT09hHCvmTsd18XYl+2Du+62D63ssNwZP3Ee0RI5jXB9U CPwA== 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:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=emgWc0DZhaROoLRi+85RpPwjTIwTzI8BVdQFWMNJRpk=; b=NnO+5NDXUrY0tV8wDGC08vtepq6xa+owRpLjx8gzjvT33n1ACSZgsvFIA5MsP7VNGJ 8mvMSy9fW31SXpzZD3meFqe+xpi1KSgIhmMmNEnqGBFoZbIEFdNaGEaD4VIoUJriJFiA 26a7ixN64PYRZuNt59ycBGKNooTNbOgWP00zSaPj5a/3kQeSziv1t2lMoj+IjRJ2gDZu uXIc2UcjmvGXsoEZzs/gnv9VuVvm88cn6xsqkyBR6+e++X1fCFTabW4e7XSOzSCa9UJ6 f5i+2+5C1n628U7Tg6dCbklQxuLRMfwAyqQZg7kUlsmlojoEMoPhT1dqECEwO8bCiwaG gopA== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 134si1608940wmm.185.2017.10.27.11.46.38; Fri, 27 Oct 2017 11:46:39 -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; 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 94FEF68A3E0; Fri, 27 Oct 2017 21:46:29 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef2.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B08B868A317 for ; Fri, 27 Oct 2017 21:46:23 +0300 (EEST) Received: from phare.normalesup.org (archicubes.ens.fr [129.199.129.80]) by nef2.ens.fr (8.13.6/1.01.28121999) with ESMTP id v9RIkVjk076641 for ; Fri, 27 Oct 2017 20:46:32 +0200 (CEST) Received: by phare.normalesup.org (Postfix, from userid 1001) id BBF3BE00C8; Fri, 27 Oct 2017 20:46:31 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Fri, 27 Oct 2017 20:46:27 +0200 Message-Id: <20171027184629.20772-1-george@nsup.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: References: X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef2.ens.fr [129.199.96.32]); Fri, 27 Oct 2017 20:46:32 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 1/3] examples/avio_reading: return AVERROR_EOF at 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Nicolas George --- doc/examples/avio_reading.c | 2 ++ 1 file changed, 2 insertions(+) Unchanged. diff --git a/doc/examples/avio_reading.c b/doc/examples/avio_reading.c index 02474e907a..7860fd5e2f 100644 --- a/doc/examples/avio_reading.c +++ b/doc/examples/avio_reading.c @@ -44,6 +44,8 @@ static int read_packet(void *opaque, uint8_t *buf, int buf_size) struct buffer_data *bd = (struct buffer_data *)opaque; buf_size = FFMIN(buf_size, bd->size); + if (!buf_size) + return AVERROR_EOF; printf("ptr:%p size:%zu\n", bd->ptr, bd->size); /* copy internal buffer data to buf */