break;
annonce_error:
- if (c->udp_cfd > 0)
+ if (c->udp_cfd >= 0)
pa_close(c->udp_cfd);
c->udp_cfd = -1;
- if (c->udp_tfd > 0)
+ if (c->udp_tfd >= 0)
pa_close(c->udp_tfd);
c->udp_tfd = -1;
break;
setup_error:
- if (c->tcp_sfd > 0)
+ if (c->tcp_sfd >= 0)
pa_close(c->tcp_sfd);
c->tcp_sfd = -1;
- if (c->udp_sfd > 0)
+ if (c->udp_sfd >= 0)
pa_close(c->udp_sfd);
c->udp_sfd = -1;
case STATE_TEARDOWN: {
pa_log_debug("RAOP: TEARDOWN");
- if (c->tcp_sfd > 0)
+ if (c->tcp_sfd >= 0)
pa_close(c->tcp_sfd);
c->tcp_sfd = -1;
- if (c->udp_sfd > 0)
+ if (c->udp_sfd >= 0)
pa_close(c->udp_sfd);
c->udp_sfd = -1;
c->is_recording = false;
- if (c->tcp_sfd > 0)
+ if (c->tcp_sfd >= 0)
pa_close(c->tcp_sfd);
c->tcp_sfd = -1;
- if (c->udp_sfd > 0)
+ if (c->udp_sfd >= 0)
pa_close(c->udp_sfd);
c->udp_sfd = -1;
switch (c->protocol) {
case PA_RAOP_PROTOCOL_TCP:
- if (c->tcp_sfd > 0)
+ if (c->tcp_sfd >= 0)
return true;
break;
case PA_RAOP_PROTOCOL_UDP:
- if (c->udp_sfd > 0)
+ if (c->udp_sfd >= 0)
return true;
break;
default:
switch (c->protocol) {
case PA_RAOP_PROTOCOL_TCP:
- if (c->tcp_sfd > 0 && c->is_recording)
+ if (c->tcp_sfd >= 0 && c->is_recording)
return true;
break;
case PA_RAOP_PROTOCOL_UDP:
- if (c->udp_sfd > 0 && c->is_recording)
+ if (c->udp_sfd >= 0 && c->is_recording)
return true;
break;
default:
switch (c->protocol) {
case PA_RAOP_PROTOCOL_TCP:
- if (c->tcp_sfd > 0 && !c->is_recording) {
+ if (c->tcp_sfd >= 0 && !c->is_recording) {
c->is_recording = true;
c->is_first_packet = true;
c->sync_count = 0;
}
break;
case PA_RAOP_PROTOCOL_UDP:
- if (c->udp_sfd > 0 && !c->is_recording) {
+ if (c->udp_sfd >= 0 && !c->is_recording) {
c->is_recording = true;
c->is_first_packet = true;
c->sync_count = 0;
void pa_raop_client_handle_oob_packet(pa_raop_client *c, const int fd, const uint8_t packet[], ssize_t size) {
pa_assert(c);
- pa_assert(fd > 0);
+ pa_assert(fd >= 0);
pa_assert(packet);
if (c->protocol == PA_RAOP_PROTOCOL_UDP) {
if (u->rtpoll_item) {
pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, &nbfds);
for (i = 0; i < nbfds; i++) {
- if (pollfd && pollfd->fd > 0)
+ if (pollfd && pollfd->fd >= 0)
pa_close(pollfd->fd);
pollfd++;
}