Author: ayoung
Date: Wed Nov 30 07:25:22 2011
New Revision: 33737
URL: http://svn.slimdevices.com/slim?rev=33737&view=rev
Log:
bug 17692: Stream proxy capability for SqueezePlay
Allow a sync-group to be restored on SN without restarting the streams if the reconnect bit is set.
Modified:
7.7/trunk/server/Slim/Control/Commands.pm
7.7/trunk/server/Slim/Control/Request.pm
7.7/trunk/server/Slim/Networking/Slimproto.pm
7.7/trunk/server/Slim/Player/Squeezebox.pm
7.7/trunk/server/Slim/Player/StreamingController.pm
7.7/trunk/server/Slim/Player/Sync.pm
Modified: 7.7/trunk/server/Slim/Control/Commands.pm
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Slim/Control/Commands.pm?rev=33737&r1=33736&r2=33737&view=diff
==============================================================================
--- 7.7/trunk/server/Slim/Control/Commands.pm (original)
+++ 7.7/trunk/server/Slim/Control/Commands.pm Wed Nov 30 07:25:22 2011
@@ -2867,6 +2867,7 @@
# get our parameters
my $client = $request->client();
my $newbuddy = $request->getParam('_indexid-');
+ my $noRestart= $request->getParam('noRestart');
if (!defined $newbuddy) {
$request->setStatusBadParams();
@@ -2890,7 +2891,7 @@
}
}
- $client->controller()->sync($buddy) if defined $buddy;
+ $client->controller()->sync($buddy, $noRestart) if defined $buddy;
}
$request->setStatusDone();
Modified: 7.7/trunk/server/Slim/Control/Request.pm
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Slim/Control/Request.pm?rev=33737&r1=33736&r2=33737&view=diff
==============================================================================
--- 7.7/trunk/server/Slim/Control/Request.pm (original)
+++ 7.7/trunk/server/Slim/Control/Request.pm Wed Nov 30 07:25:22 2011
@@ -621,7 +621,7 @@
addDispatch(['stop'], [1, 0, 0, \&Slim::Control::Commands::playcontrolCommand]);
addDispatch(['stopserver'], [0, 0, 0, \&Slim::Control::Commands::stopServer]);
addDispatch(['sync', '?'], [1, 1, 0, \&Slim::Control::Queries::syncQuery]);
- addDispatch(['sync', '_indexid-'], [1, 0, 0, \&Slim::Control::Commands::syncCommand]);
+ addDispatch(['sync', '_indexid-'], [1, 0, 1, \&Slim::Control::Commands::syncCommand]);
addDispatch(['syncgroups', '?'], [0, 1, 0, \&Slim::Control::Queries::syncGroupsQuery]);
addDispatch(['time', '?'], [1, 1, 0, \&Slim::Control::Queries::timeQuery]);
addDispatch(['time', '_newvalue'], [1, 0, 0, \&Slim::Control::Commands::timeCommand]);
Modified: 7.7/trunk/server/Slim/Networking/Slimproto.pm
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Slim/Networking/Slimproto.pm?rev=33737&r1=33736&r2=33737&view=diff
==============================================================================
--- 7.7/trunk/server/Slim/Networking/Slimproto.pm (original)
+++ 7.7/trunk/server/Slim/Networking/Slimproto.pm Wed Nov 30 07:25:22 2011
@@ -1211,7 +1211,7 @@
$client->macaddress($mac);
$client->init($deviceids[$deviceid], $capabilities, $syncgroupid);
- $client->reconnect($paddr, $revision, $s, 0, undef, $syncgroupid); # don't "reconnect" if the player is new.
+ $client->reconnect($paddr, $revision, $s, (main::SLIM_SERVICE && $reconnect), undef, $syncgroupid); # don't "reconnect" if the player is new except on SN.
} else {
Modified: 7.7/trunk/server/Slim/Player/Squeezebox.pm
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Slim/Player/Squeezebox.pm?rev=33737&r1=33736&r2=33737&view=diff
==============================================================================
--- 7.7/trunk/server/Slim/Player/Squeezebox.pm (original)
+++ 7.7/trunk/server/Slim/Player/Squeezebox.pm Wed Nov 30 07:25:22 2011
@@ -64,7 +64,7 @@
}
# check if there is a sync group to restore
- Slim::Player::Sync::restoreSync($client, $syncgroupid);
+ Slim::Player::Sync::restoreSync($client, $syncgroupid, (main::SLIM_SERVICE && $reconnect));
if ( main::SLIM_SERVICE ) {
# SN supports reconnecting from another instance
Modified: 7.7/trunk/server/Slim/Player/StreamingController.pm
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Slim/Player/StreamingController.pm?rev=33737&r1=33736&r2=33737&view=diff
==============================================================================
--- 7.7/trunk/server/Slim/Player/StreamingController.pm (original)
+++ 7.7/trunk/server/Slim/Player/StreamingController.pm Wed Nov 30 07:25:22 2011
@@ -1908,7 +1908,7 @@
}
sub sync {
- my ($self, $player) = @_;
+ my ($self, $player, $noRestart) = @_;
if ($player->controller() == $self) {
main::INFOLOG && $synclog->info($self->{'masterId'} . " sync-group already contains: " . $player->id());
@@ -1920,8 +1920,9 @@
my $other = $player->controller();
if (@{$other->{'allPlayers'}} > 1) {
- $other->unsync($player); # will also stop it, if necessary
- } elsif (!$other->isStopped()) {
+ $other->unsync($player); # will also stop it, if necessary
+ $noRestart = 0;
+ } elsif (!$noRestart && !$other->isStopped()) {
_stopClient($player);
}
@@ -1964,7 +1965,7 @@
if (isPaused($self)) {
_pauseStreaming($self, playingSong($self));
- } elsif (!isStopped($self)) {
+ } elsif (!$noRestart && !isStopped($self)) {
_JumpToTime($self, undef, {newtime => playingSongElapsed($self), restartIfNoSeek => 1});
}
} else {
Modified: 7.7/trunk/server/Slim/Player/Sync.pm
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Slim/Player/Sync.pm?rev=33737&r1=33736&r2=33737&view=diff
==============================================================================
--- 7.7/trunk/server/Slim/Player/Sync.pm (original)
+++ 7.7/trunk/server/Slim/Player/Sync.pm Wed Nov 30 07:25:22 2011
@@ -66,6 +66,7 @@
sub restoreSync {
my $client = shift;
my $syncgroupid = shift;
+ my $noRestart = shift;
if ($client->controller()->allPlayers() > 1) {
# already synced (this can get called more than once when a player first connects)
@@ -86,7 +87,7 @@
my $othermasterID = $prefs->client($other)->get('syncgroupid');
if ($othermasterID && ($othermasterID eq $syncgroupid)) {
- $other->execute( [ 'sync', $client->id ] );
+ $other->execute( [ 'sync', $client->id, 'noRestart:' . ($noRestart ? '1' : '0') ] );
last;
}
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.