diff options
author | waker <wakeroid@gmail.com> | 2009-08-16 21:43:45 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2009-08-16 21:43:45 +0200 |
commit | 090ea2c0ad39873550092bde1608ffc9ce31d296 (patch) | |
tree | 517a10cfdbbf666c05bbe97f9e08344e42bd9668 /streamer.c | |
parent | 7a72b074f0f5108ff56a7ec770a58cc0bfca908b (diff) |
fixed flac/cue playback
Diffstat (limited to 'streamer.c')
-rw-r--r-- | streamer.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -48,6 +48,13 @@ static int nextsong_pstate = -1; static float seekpos = -1; +static float playpos = 0; // play position of current song + +float +streamer_get_playpos (void) { + return playpos; +} + void streamer_set_nextsong (int song, int pstate) { nextsong = song; @@ -102,6 +109,7 @@ streamer_thread (uintptr_t ctx) { seekpos = -1; if (playlist_current.codec && playlist_current.codec->seek (pos) >= 0) { streamer_lock (); + playpos = playlist_current.codec->info.readposition; streambuffer_fill = 0; streamer_unlock (); codec_lock (); @@ -301,9 +309,7 @@ streamer_read (char *bytes, int size) { memmove (streambuffer, &streambuffer[sz], streambuffer_fill-sz); } streambuffer_fill -= sz; - if (playlist_current.codec) { - playlist_current.codec->info.position += (float)sz/p_get_rate ()/4.f; - } + playpos += (float)sz/p_get_rate ()/4.f; bytes_until_next_song -= sz; if (bytes_until_next_song < 0) { bytes_until_next_song = 0; |