diff --git a/projects/robodj/bin/musicd b/projects/robodj/bin/musicd index 314213eb..e94774d0 100755 --- a/projects/robodj/bin/musicd +++ b/projects/robodj/bin/musicd @@ -1,6 +1,6 @@ #!/usr/bin/perl -w # -# $Id: musicd,v 1.11 2001/07/26 19:26:55 mdb Exp $ +# $Id: musicd,v 1.12 2002/02/11 18:25:44 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 @@ -9,7 +9,7 @@ use strict; use IO::Socket; use IO::Select; -use MPEG::MP3Play; +use MPEG::MP3Play ':state'; use Data::Dumper; use Getopt::Long; @@ -49,6 +49,7 @@ main: { # create our MP3 interface $mp3 = new MPEG::MP3Play; + $mp3->set_player_mode(&XA_PLAYER_MODE_OUTPUT_AUTO_CLOSE_ON_STOP); # manage our various inputs my $sel = new IO::Select($sock); @@ -162,6 +163,7 @@ sub handle_client } elsif ($input =~ m/^STOP/) { $mp3->stop(); + undef $playing; print $cfh "200 Music stopped.\n"; } elsif ($input =~ m/^PLAY/) {