diff options
author | Max Kellermann <max@duempel.org> | 2011-08-31 07:46:56 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2011-08-31 07:47:01 +0200 |
commit | 2525d32e1710884984e5a2b3445b7cff37ea826e (patch) | |
tree | 1d65495ebefa5b19b6229c590f85e717107a64a9 /src/output/raop_output_plugin.c | |
parent | f3ac8a7cd91f368cef7c6cf2387680e99212356d (diff) | |
download | mpd-2525d32e1710884984e5a2b3445b7cff37ea826e.tar.gz mpd-2525d32e1710884984e5a2b3445b7cff37ea826e.tar.xz mpd-2525d32e1710884984e5a2b3445b7cff37ea826e.zip |
rtsp_client: don't wait if packet is over due
Check if the time difference is negative. That would have caused
sleeping forever.
Diffstat (limited to 'src/output/raop_output_plugin.c')
-rw-r--r-- | src/output/raop_output_plugin.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/output/raop_output_plugin.c b/src/output/raop_output_plugin.c index 745040e0f..51d1d629b 100644 --- a/src/output/raop_output_plugin.c +++ b/src/output/raop_output_plugin.c @@ -623,8 +623,9 @@ send_audio_data(int fd, GError **error_r) get_time_for_rtp(&raop_session->play_state, &rtp_time); gettimeofday(¤t_time, NULL); - int diff = difference(¤t_time, &rtp_time); - g_usleep(-diff); + int diff = difference(&rtp_time, ¤t_time); + if (diff > 0) + g_usleep(diff); gettimeofday(&raop_session->play_state.last_send, NULL); while (rd) { |