summaryrefslogtreecommitdiff
path: root/src/modules/module-solaris.c
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2012-08-30 16:50:13 +0300
committerArun Raghavan <arun.raghavan@collabora.co.uk>2012-11-16 23:16:05 +0530
commit29f064aa3d3a83e275361aad3f9e7efdc84b8ad0 (patch)
tree414fea43b6da17ba94b7d37020702aedf30168cc /src/modules/module-solaris.c
parentcd1102cce01e47645ed03ddf46a0a8b80d65fc9e (diff)
sink: Process rewind requests also when suspended.
When a rewind is requested on a sink input, the request parameters are stored in the pa_sink_input struct. The parameters are reset during rewind processing, and if the sink decides to ignore the rewind request due to being suspended, stale parameters are left in pa_sink_input. It's particularly problematic if the rewrite_bytes parameter is left at -1, because that will prevent all future rewind processing on that sink input. So, in order to avoid stale parameters, every rewind request needs to be processed, even if the sink is suspended. Reported-by: Uoti Urpala
Diffstat (limited to 'src/modules/module-solaris.c')
-rw-r--r--src/modules/module-solaris.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/modules/module-solaris.c b/src/modules/module-solaris.c
index 5081ceb7b..aaf7189fd 100644
--- a/src/modules/module-solaris.c
+++ b/src/modules/module-solaris.c
@@ -587,9 +587,12 @@ static void process_rewind(struct userdata *u) {
pa_assert(u);
- /* Figure out how much we shall rewind and reset the counter */
+ if (!PA_SINK_IS_OPENED(u->sink->thread_info.state)) {
+ pa_sink_process_rewind(u->sink, 0);
+ return;
+ }
+
rewind_nbytes = u->sink->thread_info.rewind_nbytes;
- u->sink->thread_info.rewind_nbytes = 0;
if (rewind_nbytes > 0) {
pa_log_debug("Requested to rewind %lu bytes.", (unsigned long) rewind_nbytes);
@@ -625,13 +628,13 @@ static void thread_func(void *userdata) {
for (;;) {
/* Render some data and write it to the dsp */
+ if (u->sink->thread_info.rewind_requested)
+ process_rewind(u);
+
if (u->sink && PA_SINK_IS_OPENED(u->sink->thread_info.state)) {
pa_usec_t xtime0, ysleep_interval, xsleep_interval;
uint64_t buffered_bytes;
- if (u->sink->thread_info.rewind_requested)
- process_rewind(u);
-
err = ioctl(u->fd, AUDIO_GETINFO, &info);
if (err < 0) {
pa_log("AUDIO_GETINFO ioctl failed: %s", pa_cstrerror(errno));