Skip to content

Commit

Permalink
Merge pull request #35 from jomo/shairport-patch
Browse files Browse the repository at this point in the history
Make mpd play nicely with shairport
  • Loading branch information
volumio committed Nov 20, 2014
2 parents ec4c85f + ecbdfc4 commit fdb1e0c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion command/player_wrk.php
Expand Up @@ -307,7 +307,8 @@
// Start Shairport with Volumio name, stopping Mpd on start, with Selected output device
playerSession('open',$db);
$hostname = $_SESSION['hostname'];
$cmd = '/usr/local/bin/shairport -a "'.$hostname.'" -w -B "mpc stop" -o alsa -- -d plughw:'.$device.' > /dev/null 2>&1 &';
$tempfile = '/tmp/.restart_mpd'; // if this file exists, start playing mpd after shairport stopped
$cmd = '/usr/local/bin/shairport -a "'.$hostname.'" -w -B "(/usr/bin/mpc | grep -q playing && touch \''.$tempfile.'\'); /usr/bin/mpc stop" -E "test -f \''.$tempfile.'\' && /usr/bin/mpc play && rm -f \''.$tempfile.'\'" -o alsa -- -d plughw:'.$device.' > /dev/null 2>&1 &';
sysCmd($cmd);
}

Expand Down

0 comments on commit fdb1e0c

Please sign in to comment.