From patchwork Fri Sep 30 09:29:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 788 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.66 with SMTP id o63csp123995vsd; Fri, 30 Sep 2016 02:29:51 -0700 (PDT) X-Received: by 10.28.58.10 with SMTP id h10mr2676963wma.133.1475227791306; Fri, 30 Sep 2016 02:29:51 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id ia7si19731774wjb.123.2016.09.30.02.29.50; Fri, 30 Sep 2016 02:29:51 -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 60383689FB5; Fri, 30 Sep 2016 12:29:26 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AEE13689B19 for ; Fri, 30 Sep 2016 12:29:19 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 8BF94100E1B; Fri, 30 Sep 2016 11:29:32 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RPY54VdzPBmF; Fri, 30 Sep 2016 11:29:31 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id D55A5100CEF; Fri, 30 Sep 2016 11:29:30 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Fri, 30 Sep 2016 11:29:07 +0200 Message-Id: <1475227747-11938-3-git-send-email-cus@passwd.hu> X-Mailer: git-send-email 2.6.6 In-Reply-To: <1475227747-11938-1-git-send-email-cus@passwd.hu> References: <1475227747-11938-1-git-send-email-cus@passwd.hu> Subject: [FFmpeg-devel] [PATCH 3/3] lavd/openal: return EAGAIN if no samples are available 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: Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Marton Balint --- libavdevice/openal-dec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavdevice/openal-dec.c b/libavdevice/openal-dec.c index 0647952..8773944 100644 --- a/libavdevice/openal-dec.c +++ b/libavdevice/openal-dec.c @@ -191,6 +191,9 @@ static int read_packet(AVFormatContext* ctx, AVPacket *pkt) alcGetIntegerv(ad->device, ALC_CAPTURE_SAMPLES, (ALCsizei) sizeof(ALCint), &nb_samples); if (error = al_get_error(ad->device, &error_msg)) goto fail; + if (nb_samples == 0) + return AVERROR(EAGAIN); + /* Create a packet of appropriate size */ if ((error = av_new_packet(pkt, nb_samples*ad->sample_step)) < 0) goto fail;