mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-07-21 10:16:14 +00:00
module-rtp: only stop timer when it was running
This commit is contained in:
parent
49e7e3a0f0
commit
5082e9f458
|
@ -201,6 +201,7 @@ static void set_timer(struct impl *impl, uint64_t time, uint64_t itime)
|
|||
ts.it_interval.tv_nsec = itime % SPA_NSEC_PER_SEC;
|
||||
spa_system_timerfd_settime(impl->data_loop->system,
|
||||
impl->timer->fd, SPA_FD_TIMER_ABSTIME, &ts, NULL);
|
||||
impl->timer_running = time != 0 && itime != 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
@ -263,7 +264,7 @@ static void rtp_audio_flush_packets(struct impl *impl, uint32_t num_packets)
|
|||
}
|
||||
spa_ringbuffer_read_update(&impl->ring, timestamp);
|
||||
done:
|
||||
if (avail < tosend)
|
||||
if (avail < tosend && impl->timer_running)
|
||||
set_timer(impl, 0, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -87,6 +87,7 @@ struct impl {
|
|||
|
||||
struct pw_loop *data_loop;
|
||||
struct spa_source *timer;
|
||||
bool timer_running;
|
||||
|
||||
int (*receive_rtp)(struct impl *impl, uint8_t *buffer, ssize_t len);
|
||||
void (*flush_timeout)(struct impl *impl, uint64_t expirations);
|
||||
|
|
Loading…
Reference in a new issue