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.
This commit is contained in:
Nicolas Dufresne 2014-11-27 13:52:52 -05:00
parent 3cc9b2c490
commit eddb543719

View file

@ -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);