summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-04-25 16:44:09 +0200
committerGravatar Alexey Yakovenko <waker@users.sourceforge.net>2014-04-25 16:44:09 +0200
commitc4a24df8d5ee18b7e249db57136ca8f8fea0064b (patch)
tree955a2ec7ae895597bfb9dd5a2bf4acccb755ee7c /plugins
parent847d899c197b7cb010d965d23cc0b285f841ab31 (diff)
fixed streaming audio seek issues (bug #1098)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/gtkui/ddbseekbar.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/plugins/gtkui/ddbseekbar.c b/plugins/gtkui/ddbseekbar.c
index 71243c80..bd3b01dd 100644
--- a/plugins/gtkui/ddbseekbar.c
+++ b/plugins/gtkui/ddbseekbar.c
@@ -438,13 +438,15 @@ on_seekbar_button_release_event (GtkWidget *widget,
self->seekbar_moved = 1.0;
DB_playItem_t *trk = deadbeef->streamer_get_playing_track ();
if (trk) {
- GtkAllocation a;
- gtk_widget_get_allocation (widget, &a);
- float time = (event->x - a.x) * deadbeef->pl_get_item_duration (trk) / (a.width);
- if (time < 0) {
- time = 0;
+ if (deadbeef->pl_get_item_duration (trk) >= 0) {
+ GtkAllocation a;
+ gtk_widget_get_allocation (widget, &a);
+ float time = (event->x - a.x) * deadbeef->pl_get_item_duration (trk) / (a.width);
+ if (time < 0) {
+ time = 0;
+ }
+ deadbeef->sendmessage (DB_EV_SEEK, 0, time * 1000, 0);
}
- deadbeef->sendmessage (DB_EV_SEEK, 0, time * 1000, 0);
deadbeef->pl_item_unref (trk);
}
gtk_widget_queue_draw (widget);