]> code.delx.au - pulseaudio/commit
combine: Keep the timer active in the null mode only when running.
authorTanu Kaskinen <tanuk@iki.fi>
Thu, 20 Sep 2012 06:42:18 +0000 (09:42 +0300)
committerTanu Kaskinen <tanuk@iki.fi>
Tue, 30 Oct 2012 14:30:08 +0000 (16:30 +0200)
commit0da87df4ec0e568a54f4560814e31dfdec4c5b50
treebc2cda9b26d0880c2ec7e0b8d0733ddc12577435
parent3adbb5ad034684ff751def0144764be8442fb15c
combine: Keep the timer active in the null mode only when running.

Previously thread_func() used PA_SINK_IS_OPENED() to check whether
some data should be rendered. process_render_null() used a different
check: it would return immediately if the sink was not in the RUNNING
state. This caused a busy loop when the sink was in the IDLE state,
because process_render_null() didn't update the timestamp, and
thread_func() still kept the timer active using the old timestamp.
pa_rtpoll_run() would return immediately because of the old timestamp.

This is fixed by using the same check in both thread_func() and
process_render_null(). Since the checks are the same, it's actually
redundant to have the check in process_render_null(), so it is now an
assertion.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=54779
src/modules/module-combine-sink.c