diff options
author | Lennart Poettering <lennart@poettering.net> | 2008-06-26 02:56:00 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2008-06-26 02:56:00 +0200 |
commit | eab1cb8df952bc302d14efd1640d96f8bbdb148a (patch) | |
tree | d3de307ecdaa284308e7d726153ffb6a10f012cc /src/modules | |
parent | 1e36b57b13d421dab20c436e0ae302acc34fbac9 (diff) | |
download | pulseaudio-eab1cb8df952bc302d14efd1640d96f8bbdb148a.tar.gz |
make sure to call process_rewind() under all circumstances before we do the next loop iteration
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/module-alsa-sink.c | 11 | ||||
-rw-r--r-- | src/modules/module-combine.c | 1 | ||||
-rw-r--r-- | src/modules/module-esound-sink.c | 4 | ||||
-rw-r--r-- | src/modules/module-jack-sink.c | 4 | ||||
-rw-r--r-- | src/modules/module-null-sink.c | 8 | ||||
-rw-r--r-- | src/modules/module-pipe-sink.c | 8 | ||||
-rw-r--r-- | src/modules/module-tunnel.c | 6 |
7 files changed, 33 insertions, 9 deletions
diff --git a/src/modules/module-alsa-sink.c b/src/modules/module-alsa-sink.c index 6765775a0..5818dee2c 100644 --- a/src/modules/module-alsa-sink.c +++ b/src/modules/module-alsa-sink.c @@ -882,7 +882,7 @@ static void sink_update_requested_latency_cb(pa_sink *s) { if (u->hwbuf_unused_frames > before) { pa_log_debug("Requesting rewind due to latency change."); - pa_sink_request_rewind(s, 0); + pa_sink_request_rewind(s, (size_t) -1); } } @@ -967,9 +967,12 @@ static void thread_func(void *userdata) { int work_done; pa_usec_t sleep_usec; - if (u->sink->thread_info.rewind_nbytes > 0) - if (process_rewind(u) < 0) - goto fail; + if (u->sink->thread_info.rewind_requested) { + if (u->sink->thread_info.rewind_nbytes <= 0) + pa_sink_process_rewind(u->sink, 0); + else if (process_rewind(u) < 0) + goto fail; + } if (u->use_mmap) work_done = mmap_write(u, &sleep_usec); diff --git a/src/modules/module-combine.c b/src/modules/module-combine.c index 8c155da00..7d8e140b3 100644 --- a/src/modules/module-combine.c +++ b/src/modules/module-combine.c @@ -410,7 +410,6 @@ static void sink_input_process_rewind_cb(pa_sink_input *i, size_t nbytes) { struct output *o; pa_sink_input_assert_ref(i); - pa_assert(nbytes > 0); pa_assert_se(o = i->userdata); pa_memblockq_rewind(o->memblockq, nbytes); diff --git a/src/modules/module-esound-sink.c b/src/modules/module-esound-sink.c index e189febdf..6ca649782 100644 --- a/src/modules/module-esound-sink.c +++ b/src/modules/module-esound-sink.c @@ -204,6 +204,10 @@ static void thread_func(void *userdata) { for (;;) { int ret; + if (PA_SINK_IS_OPENED(u->sink->thread_info.state)) + if (u->sink->thread_info.rewind_requested) + pa_sink_process_rewind(u->sink, 0); + if (u->rtpoll_item) { struct pollfd *pollfd; pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL); diff --git a/src/modules/module-jack-sink.c b/src/modules/module-jack-sink.c index c4d47f8e9..edc543a85 100644 --- a/src/modules/module-jack-sink.c +++ b/src/modules/module-jack-sink.c @@ -222,6 +222,10 @@ static void thread_func(void *userdata) { for (;;) { int ret; + if (PA_SINK_IS_OPENED(u->sink->thread_info.state)) + if (u->sink->thread_info.rewind_requested) + pa_sink_process_rewind(u->sink, 0); + if ((ret = pa_rtpoll_run(u->rtpoll, TRUE)) < 0) goto fail; diff --git a/src/modules/module-null-sink.c b/src/modules/module-null-sink.c index 604ab1589..9162960fe 100644 --- a/src/modules/module-null-sink.c +++ b/src/modules/module-null-sink.c @@ -204,8 +204,12 @@ static void thread_func(void *userdata) { now = pa_rtclock_usec(); - if (u->sink->thread_info.rewind_nbytes > 0) - process_rewind(u, now); + if (u->sink->thread_info.rewind_requested) { + if (u->sink->thread_info.rewind_nbytes > 0) + process_rewind(u, now); + else + pa_sink_process_rewind(u->sink, 0); + } if (u->timestamp <= now) process_render(u, now); diff --git a/src/modules/module-pipe-sink.c b/src/modules/module-pipe-sink.c index cd25b8900..0999935ba 100644 --- a/src/modules/module-pipe-sink.c +++ b/src/modules/module-pipe-sink.c @@ -184,8 +184,12 @@ static void thread_func(void *userdata) { /* Render some data and write it to the fifo */ if (u->sink->thread_info.state == PA_SINK_RUNNING) { - if (u->sink->thread_info.rewind_nbytes > 0) - process_rewind(u); + if (u->sink->thread_info.rewind_requested) { + if (u->sink->thread_info.rewind_nbytes > 0) + process_rewind(u); + else + pa_sink_process_rewind(u->sink, 0); + } if (pollfd->revents) { if (process_render(u) < 0) diff --git a/src/modules/module-tunnel.c b/src/modules/module-tunnel.c index 86f30817d..1890646f1 100644 --- a/src/modules/module-tunnel.c +++ b/src/modules/module-tunnel.c @@ -605,6 +605,12 @@ static void thread_func(void *userdata) { for (;;) { int ret; +#ifdef TUNNEL_SINK + if (PA_SINK_IS_OPENED(u->sink->thread_info.state)) + if (u->sink->thread_info.rewind_requested) + pa_sink_process_rewind(u->sink, 0); +#endif + if ((ret = pa_rtpoll_run(u->rtpoll, TRUE)) < 0) goto fail; |