changeset 4730:f9b49a8913b7

minimal interface: improve sanity for playback_seek() to make seek times more accurate.
author William Pitcock <nenolod@atheme.org>
date Thu, 17 Jul 2008 03:38:00 -0500
parents 5e70c200eb8d
children c43530370508
files src/audacious/ui_new.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/ui_new.c	Wed Jul 16 17:32:37 2008 -0500
+++ b/src/audacious/ui_new.c	Thu Jul 17 03:38:00 2008 -0500
@@ -170,9 +170,13 @@
 static gboolean
 ui_slider_value_changed_cb(GtkRange *range, gpointer user_data)
 {
-    /* we are not allowed to do a playback_seek() with values < 1, therefore
-     * we add 1 to be on the safe side --mf0102 */
-    playback_seek(gtk_range_get_value(range)/1000 + 1);
+    gint seek_;
+
+    seek_ = gtk_range_get_value(range) / 1000;
+
+    /* XXX: work around a horrible bug in playback_seek(), also
+       we should do mseek here. --nenolod */
+    playback_seek(seek_ != 0 ? seek_ : 1);
 
     return TRUE;
 }