[PATCH 19/25] raop: Set poll timer when entering the RUNNING state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When pausing music, the raop module enters the IDLE state.
If you resume the music right after pausing, the module enters
the RUNNING state but the poll timer is left expired.
This prevents the main thread loop from sending audio packets.

To avoid this situation, set the poll timer again when the module
enters the RUNNING state.
---
 src/modules/raop/module-raop-sink.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/modules/raop/module-raop-sink.c b/src/modules/raop/module-raop-sink.c
index 0038bad..cc8bff4 100644
--- a/src/modules/raop/module-raop-sink.c
+++ b/src/modules/raop/module-raop-sink.c
@@ -318,6 +318,7 @@ static int udp_sink_process_msg(pa_msgobject *o, int code, void *data, int64_t o
                         /* Connecting will trigger a RECORD */
                         pa_raop_client_connect(u->raop);
                     }
+                    pa_rtpoll_set_timer_relative(u->rtpoll, pa_bytes_to_usec(u->block_size, &u->sink->sample_spec));
 
                     break;
 
@@ -364,6 +365,7 @@ static int udp_sink_process_msg(pa_msgobject *o, int code, void *data, int64_t o
 
             if (u->sink->thread_info.state == PA_SINK_SUSPENDED) {
                 /* Our stream has been suspended so we just flush it... */
+                pa_rtpoll_set_timer_disabled(u->rtpoll);
                 pa_raop_client_flush(u->raop);
             }
 
-- 
1.8.1.2



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux