From 1ffbfd8c4575fc945a2ead2b993f975a328fcb04 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Sun, 28 Sep 2014 22:09:22 +0200 Subject: [PATCH] Proper update to libevent 2 in player.c --- src/player.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/player.c b/src/player.c index 180881d9..4ba89298 100644 --- a/src/player.c +++ b/src/player.c @@ -39,8 +39,10 @@ #ifdef HAVE_LIBEVENT2 # include +# include #else # include +# define evbuffer_get_length(x) EVBUFFER_LENGTH(x) #endif #include @@ -1601,7 +1603,7 @@ source_read(uint8_t *buf, int len, uint64_t rtptime) return -1; } - if (EVBUFFER_LENGTH(audio_buf) == 0) + if (evbuffer_get_length(audio_buf) == 0) { switch (cur_streaming->type) { @@ -2209,7 +2211,7 @@ playback_abort(void) cur_playing = NULL; cur_streaming = NULL; - evbuffer_drain(audio_buf, EVBUFFER_LENGTH(audio_buf)); + evbuffer_drain(audio_buf, evbuffer_get_length(audio_buf)); status_update(PLAY_STOPPED); @@ -2343,7 +2345,7 @@ playback_stop(struct player_command *cmd) cur_playing = NULL; cur_streaming = NULL; - evbuffer_drain(audio_buf, EVBUFFER_LENGTH(audio_buf)); + evbuffer_drain(audio_buf, evbuffer_get_length(audio_buf)); status_update(PLAY_STOPPED); @@ -2839,7 +2841,7 @@ playback_pause(struct player_command *cmd) cur_streaming = ps; cur_streaming->play_next = NULL; - evbuffer_drain(audio_buf, EVBUFFER_LENGTH(audio_buf)); + evbuffer_drain(audio_buf, evbuffer_get_length(audio_buf)); metadata_purge();