[FFmpeg-devel] [PATCH 3/3] lavd/openal: return EAGAIN if no samples are available

Marton Balint cus at passwd.hu
Fri Sep 30 12:29:07 EEST 2016


Signed-off-by: Marton Balint <cus at passwd.hu>
---
 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;
-- 
2.6.6



More information about the ffmpeg-devel mailing list