From 3a9697adf268d780500cc53432efa4f164db7bb4 Mon Sep 17 00:00:00 2001 From: Maarten Sebregts Date: Mon, 19 Dec 2011 21:15:00 +0100 Subject: Playlist: fix bug in moving after current song Moving songs using either 'move' or 'moveid' to position -1 (after the current song) would fail for a song which is just before the current song. This patch corrects the check to see if the current song is in the range to be moved. Since the range is from `start` up to `end` (exclusive) the check was incorrect, but is now fixed. --- NEWS | 1 + src/playlist_edit.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index bc229304a..acbc242d3 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ ver 0.16.7 (2011/??/??) * output: - httpd: fix excessive buffering - openal: force 16 bit playback, as 8 bit doesn't work +* fix moving after current song ver 0.16.6 (2011/12/01) diff --git a/src/playlist_edit.c b/src/playlist_edit.c index c54b72750..3bcb2ce14 100644 --- a/src/playlist_edit.c +++ b/src/playlist_edit.c @@ -356,7 +356,7 @@ playlist_move_range(struct playlist *playlist, playlist->current) : -1; if (to < 0 && playlist->current >= 0) { - if (start <= (unsigned)currentSong && (unsigned)currentSong <= end) + if (start <= (unsigned)currentSong && (unsigned)currentSong < end) /* no-op, can't be moved to offset of itself */ return PLAYLIST_RESULT_SUCCESS; to = (currentSong + abs(to)) % queue_length(&playlist->queue); -- cgit v1.2.3 From f405d27c56610b4cd466cf3cf81d4079924168dd Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 24 Dec 2011 17:56:10 +0100 Subject: output/osx: remove sleep call from render callback Blocking inside the render callback is forbidden, and this sleep call didn't make any sense. --- NEWS | 1 + src/output/osx_plugin.c | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/NEWS b/NEWS index acbc242d3..212648f20 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ ver 0.16.7 (2011/??/??) * output: - httpd: fix excessive buffering - openal: force 16 bit playback, as 8 bit doesn't work + - osx: remove sleep call from render callback * fix moving after current song diff --git a/src/output/osx_plugin.c b/src/output/osx_plugin.c index 7639f3bd9..d7abae096 100644 --- a/src/output/osx_plugin.c +++ b/src/output/osx_plugin.c @@ -142,10 +142,6 @@ osx_render(void *vdata, buffer->mDataByteSize = buffer_size; - if (!buffer_size) { - g_usleep(1000); - } - return 0; } -- cgit v1.2.3 From 97b4a6b51f146b16eeac9334605f8a6fff1c0af7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 24 Dec 2011 17:54:41 +0100 Subject: output/osx: clear render buffer when there's not enough data When we don't have enough data, generate some silence, hoping the input buffer will fill soon. Reducing the render buffer size is not legal. --- NEWS | 1 + src/output/osx_plugin.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 212648f20..8a2f11be6 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ ver 0.16.7 (2011/??/??) - httpd: fix excessive buffering - openal: force 16 bit playback, as 8 bit doesn't work - osx: remove sleep call from render callback + - osx: clear render buffer when there's not enough data * fix moving after current song diff --git a/src/output/osx_plugin.c b/src/output/osx_plugin.c index d7abae096..5284afc29 100644 --- a/src/output/osx_plugin.c +++ b/src/output/osx_plugin.c @@ -118,7 +118,6 @@ osx_render(void *vdata, g_mutex_lock(od->mutex); bytes_to_copy = MIN(od->len, buffer_size); - buffer_size = bytes_to_copy; od->len -= bytes_to_copy; trailer_length = od->buffer_size - od->pos; @@ -140,7 +139,9 @@ osx_render(void *vdata, g_cond_signal(od->condition); g_mutex_unlock(od->mutex); - buffer->mDataByteSize = buffer_size; + if (bytes_to_copy < buffer_size) + memset((unsigned char*)buffer->mData + bytes_to_copy, 0, + buffer_size - bytes_to_copy); return 0; } -- cgit v1.2.3