summaryrefslogtreecommitdiff
path: root/streamer.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-12-06 20:07:30 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-12-06 20:07:30 +0100
commit6778b15370f2eeeea1c0feb3e7ae149e8e500619 (patch)
treefbde7fed3441527fd23abcce84d404e492c9bedd /streamer.c
parent8fb35c5c367f6eb099435c6a226ec4440e8b71e1 (diff)
fixed crashbug in streamer when seeking close to end of track
Diffstat (limited to 'streamer.c')
-rw-r--r--streamer.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/streamer.c b/streamer.c
index cede8b71..4266486d 100644
--- a/streamer.c
+++ b/streamer.c
@@ -380,6 +380,7 @@ streamer_thread (void *ctx) {
seekpos = -1;
if (orig_playing_song != orig_streaming_song) {
+ trace ("streamer already switched to next track\n");
// restart playing from new position
if(str_streaming_song.decoder) {
str_streaming_song.decoder->free ();
@@ -388,6 +389,14 @@ streamer_thread (void *ctx) {
orig_streaming_song = orig_playing_song;
pl_item_copy (&str_streaming_song, orig_streaming_song);
bytes_until_next_song = -1;
+ int ret = str_streaming_song.decoder->init (DB_PLAYITEM (orig_streaming_song));
+ if (ret < 0) {
+ trace ("failed to restart prev track on seek, trying to jump to next track\n");
+ pl_nextsong (0);
+ trace ("pl_nextsong switched to track %d\n", nextsong);
+ usleep (50000);
+ continue;
+ }
}
streamer_buffering = 1;