changeset 2262:f51a47e53d4f

Gapless audio fixes.
author William Pitcock <nenolod@atheme.org>
date Sun, 23 Dec 2007 17:50:53 -0600
parents b71d8bee8882
children d3b950ee7e5f
files src/pulse_audio/pulse_audio.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/pulse_audio/pulse_audio.c	Fri Dec 21 12:17:25 2007 -0600
+++ b/src/pulse_audio/pulse_audio.c	Sun Dec 23 17:50:53 2007 -0600
@@ -70,7 +70,7 @@
 
 static const char* get_song_name(void) {
     static char t[256];
-    gint session, pos;
+    gint pos;
     char *str, *u;
     Playlist *playlist = aud_playlist_get_active();
 
@@ -416,6 +416,11 @@
     pa_threaded_mainloop_lock(mainloop);
     CHECK_DEAD_GOTO(fail, 1);
 
+    /* gapless playback: new stream, reset the title. --nenolod */
+    if (time == 0) {
+        pa_stream_set_name(stream, get_song_name(), stream_success_cb, &success);
+    }
+
     if (!(o = pa_stream_flush(stream, stream_success_cb, &success))) {
         g_warning("pa_stream_flush() failed: %s", pa_strerror(pa_context_errno(context)));
         goto fail;