lavd/pulse_audio_enc: respect minreq while checking buffer fullness
authorLukasz Marek <lukasz.m.luki2@gmail.com>
Tue, 29 Apr 2014 22:30:17 +0000 (00:30 +0200)
committerLukasz Marek <lukasz.m.luki2@gmail.com>
Tue, 29 Apr 2014 22:36:14 +0000 (00:36 +0200)
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
libavdevice/pulse_audio_enc.c

index 01b9785..b07d4c0 100644 (file)
@@ -647,7 +647,7 @@ static int pulse_write_packet(AVFormatContext *h, AVPacket *pkt)
         av_log(s, AV_LOG_ERROR, "PulseAudio stream is in invalid state.\n");
         goto fail;
     }
-    while (!pa_stream_writable_size(s->stream)) {
+    while (pa_stream_writable_size(s->stream) < s->minreq) {
         if (s->nonblocking) {
             pa_threaded_mainloop_unlock(s->mainloop);
             return AVERROR(EAGAIN);