[Slim-Checkins] r10648 - in /trunk/server/Slim: Player/Protocols/MMS.pm Utils/Scanner.pm

andy at svn.slimdevices.com andy at svn.slimdevices.com
Fri Nov 10 07:21:46 PST 2006


Author: andy
Date: Fri Nov 10 07:21:46 2006
New Revision: 10648

URL: http://svn.slimdevices.com?rev=10648&view=rev
Log:
WMA fixes: Only generate random GUID once.  Properly set both Pragma headers for WMA scan

Modified:
    trunk/server/Slim/Player/Protocols/MMS.pm
    trunk/server/Slim/Utils/Scanner.pm

Modified: trunk/server/Slim/Player/Protocols/MMS.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Player/Protocols/MMS.pm?rev=10648&r1=10647&r2=10648&view=diff
==============================================================================
--- trunk/server/Slim/Player/Protocols/MMS.pm (original)
+++ trunk/server/Slim/Player/Protocols/MMS.pm Fri Nov 10 07:21:46 2006
@@ -23,6 +23,9 @@
 
 use constant DEFAULT_TYPE => 'wma';
 
+# Use the same random GUID for all connections
+our $guid;
+
 =head2 new ( $class, $args )
 
 Create a new instance of the MMS protocol handler, only for transcoding using wmadec or
@@ -74,7 +77,10 @@
 }
 
 sub randomGUID {
-	my $guid = '';
+
+	return $guid if $guid;
+	
+	$guid = '';
 
 	for my $digit (0...31) {
 

Modified: trunk/server/Slim/Utils/Scanner.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Utils/Scanner.pm?rev=10648&r1=10647&r2=10648&view=diff
==============================================================================
--- trunk/server/Slim/Utils/Scanner.pm (original)
+++ trunk/server/Slim/Utils/Scanner.pm Fri Nov 10 07:21:46 2006
@@ -471,8 +471,10 @@
 	my $h = $request->headers;
 	$h->header( Accept => '*/*' );
 	$h->header( 'User-Agent' => 'NSPlayer/4.1.0.3856' );
-	$h->header( Pragma => 'xClientGUID={' . Slim::Player::Protocols::MMS::randomGUID(). '}' );
-	$h->header( Pragma => 'no-cache,rate=1.0000000,stream-time=0,stream-offset=0:0,request-context=1,max-duration=0' );
+	$h->header( Pragma => [
+		'xClientGUID={' . Slim::Player::Protocols::MMS::randomGUID(). '}',
+		'no-cache,rate=1.0000000,stream-time=0,stream-offset=0:0,request-context=1,max-duration=0',
+	] );
 	$h->header( Connection => 'close' );
 }
 
@@ -859,10 +861,8 @@
 				
 				return;
 			}
-			else {
 			
-				return $cb->( $foundItems, @{$pt} );
-			}
+			return $cb->( $foundItems, @{$pt} );
 		}
 		$offset++;
 	}



More information about the checkins mailing list