Commit 7e6bb053 authored by RODRIGUEZ Christophe's avatar RODRIGUEZ Christophe Committed by Georg Chini
Browse files

raop: Code clarification : Detect raop_client recording state in a proper way

parent 3e66643f
......@@ -1565,6 +1565,10 @@ bool pa_raop_client_can_stream(pa_raop_client *c) {
return false;
}
bool pa_raop_client_is_recording(pa_raop_client *c) {
return c->is_recording;
}
int pa_raop_client_stream(pa_raop_client *c) {
int rv = 0;
......
......@@ -65,6 +65,7 @@ bool pa_raop_client_is_authenticated(pa_raop_client *c);
int pa_raop_client_announce(pa_raop_client *c);
bool pa_raop_client_is_alive(pa_raop_client *c);
bool pa_raop_client_is_recording(pa_raop_client *c);
bool pa_raop_client_can_stream(pa_raop_client *c);
int pa_raop_client_stream(pa_raop_client *c);
int pa_raop_client_set_volume(pa_raop_client *c, pa_volume_t volume);
......
......@@ -268,7 +268,7 @@ static int sink_set_state_in_io_thread_cb(pa_sink *s, pa_sink_state_t new_state,
if (!pa_raop_client_is_alive(u->raop)) {
/* Connecting will trigger a RECORD and start steaming */
pa_raop_client_announce(u->raop);
} else if (!pa_raop_client_can_stream(u->raop)) {
} else if (!pa_raop_client_is_recording(u->raop)) {
/* RECORD alredy sent, simply start streaming */
pa_raop_client_stream(u->raop);
pa_rtpoll_set_timer_absolute(u->rtpoll, now);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment