Commit 2525d32e authored by Max Kellermann's avatar Max Kellermann

rtsp_client: don't wait if packet is over due

Check if the time difference is negative. That would have caused sleeping forever.
parent f3ac8a7c
......@@ -623,8 +623,9 @@ send_audio_data(int fd, GError **error_r)
get_time_for_rtp(&raop_session->play_state, &rtp_time);
gettimeofday(&current_time, NULL);
int diff = difference(&current_time, &rtp_time);
g_usleep(-diff);
int diff = difference(&rtp_time, &current_time);
if (diff > 0)
g_usleep(diff);
gettimeofday(&raop_session->play_state.last_send, NULL);
while (rd) {
......
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