since stuff like vorbis streams report actual time into stream,

not time played, for previous add a hack where we record the difference
in time between previous presses

git-svn-id: https://svn.musicpd.org/mpd/trunk@1440 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Warren Dukes 2004-06-10 21:42:20 +00:00
parent 3b1efb5588
commit 43255a7f63
3 changed files with 8 additions and 9 deletions

4
TODO
View File

@ -2,10 +2,6 @@
*) Fix charset errors so they don't goto stderr/out *) Fix charset errors so they don't goto stderr/out
*) compute time of vorbis from actual number of samples played
*) remove previous hack for streams
Post-1.0 Post-1.0
-------- --------
1) crosslink "list" stuff, for example, artists are crosslinked to alubms and 1) crosslink "list" stuff, for example, artists are crosslinked to alubms and

View File

@ -318,7 +318,8 @@ int ogg_decode(OutputBuffer * cb, DecoderControl * dc, InputStream * inStream)
sendDataToOutputBuffer(cb, inStream, dc, sendDataToOutputBuffer(cb, inStream, dc,
inStream->seekable, inStream->seekable,
chunk, chunkpos, chunk, chunkpos,
ov_time_tell(&vf), ov_pcm_tell(&vf)/
dc->audioFormat.sampleRate,
bitRate); bitRate);
if(dc->stop) break; if(dc->stop) break;

View File

@ -1165,14 +1165,16 @@ int setPlaylistRandomStatus(FILE * fp, int status) {
} }
int previousSongInPlaylist(FILE * fp) { int previousSongInPlaylist(FILE * fp) {
static time_t lastTime = 0;
time_t diff = time(NULL) - lastTime;
lastTime += diff;
if(playlist_state!=PLAYLIST_STATE_PLAY) return 0; if(playlist_state!=PLAYLIST_STATE_PLAY) return 0;
syncPlaylistWithQueue(0); syncPlaylistWithQueue(0);
if (getPlayerElapsedTime()>PLAYLIST_PREV_UNLESS_ELAPSED && if (diff && getPlayerElapsedTime() > PLAYLIST_PREV_UNLESS_ELAPSED) {
playlist.songs[playlist.order[playlist.current]]->type
!= SONG_TYPE_URL)
{
return playPlaylistOrderNumber(fp,playlist.current); return playPlaylistOrderNumber(fp,playlist.current);
} }
else { else {