From eddb5437192c088c3ba62229e2a9a4cd3aa08a7a Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Thu, 27 Nov 2014 13:52:52 -0500 Subject: [PATCH] audiosrc: Leave read loop if no longer running In the case a src stops providing data (read calls returns 0). The audio src thread will never leave. Instead, check the condition and leave the loop. --- gst-libs/gst/audio/gstaudiosrc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/audio/gstaudiosrc.c b/gst-libs/gst/audio/gstaudiosrc.c index efd9947a55..96871da4ad 100644 --- a/gst-libs/gst/audio/gstaudiosrc.c +++ b/gst-libs/gst/audio/gstaudiosrc.c @@ -246,7 +246,8 @@ audioringbuffer_thread_func (GstAudioRingBuffer * buf) } left -= read; readptr += read; - } while (left > 0); + + } while (left > 0 && g_atomic_int_get (&abuf->running)); /* Update timestamp on buffer if required */ gst_audio_ring_buffer_set_timestamp (buf, readseg, timestamp);