If we remove a song from earlier in the playlist than the currently

playing song, we need to adjust the currently playing index accordingly.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@216 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2001-07-26 19:26:55 +00:00
parent 44c20b3412
commit 653347e6b8
+3 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
#
# $Id: musicd,v 1.10 2001/07/13 00:39:32 mdb Exp $
# $Id: musicd,v 1.11 2001/07/26 19:26:55 mdb Exp $
#
# MP3 audio server. Manages playlists of mp3 files that live on a local
# filesystem. The playlists can be manipulated by connecting to the server
@@ -130,6 +130,8 @@ sub handle_client
if ($playlist[$i]->[1] == $sid) {
$sidx = $i;
splice(@playlist, $i, 1);
# adjust the playing index if necessary
$index -= 1 if ($i < $index);
last;
}
}