[Slim-Checkins] r10236 - in /trunk/server: Changelog6.html Slim/Utils/Scanner.pm

andy at svn.slimdevices.com andy at svn.slimdevices.com
Fri Oct 6 08:30:13 PDT 2006


Author: andy
Date: Fri Oct  6 08:30:12 2006
New Revision: 10236

URL: http://svn.slimdevices.com?rev=10236&view=rev
Log:
Bug 4303, skip ASX playlist items with bad content-types if there are additional streams to try

Modified:
    trunk/server/Changelog6.html
    trunk/server/Slim/Utils/Scanner.pm

Modified: trunk/server/Changelog6.html
URL: http://svn.slimdevices.com/trunk/server/Changelog6.html?rev=10236&r1=10235&r2=10236&view=diff
==============================================================================
--- trunk/server/Changelog6.html (original)
+++ trunk/server/Changelog6.html Fri Oct  6 08:30:12 2006
@@ -62,6 +62,7 @@
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4270">#4270</a> - Server Information on SB - two items muddled up</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4281">#4281</a> - Mix do not work with accented characters in filenames and paths</li>
 		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4291">#4291</a> - if you change the http or cli port, mdns doesn't update its advertisements</li>
+		<li><a href="http://bugs.slimdevices.com/show_bug.cgi?id=4303">#4303</a> - Second WMA stream in playlist not used</li>
 	</ul>
 </ul>
 

Modified: trunk/server/Slim/Utils/Scanner.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Utils/Scanner.pm?rev=10236&r1=10235&r2=10236&view=diff
==============================================================================
--- trunk/server/Slim/Utils/Scanner.pm (original)
+++ trunk/server/Slim/Utils/Scanner.pm Fri Oct  6 08:30:12 2006
@@ -931,6 +931,8 @@
 		return;
 	}
 	
+	$::d_scan && msg("scanWMA: Checking stream at " . $request->uri . "\n");
+	
 	my $http = Slim::Networking::Async::HTTP->new();
 	$http->send_request( {
 		'request'     => $request,
@@ -960,17 +962,38 @@
 		&& $type ne 'audio/x-ms-wma'
 		&& $type ne 'audio/asf'
 	) {
-		# It's not audio, treat it as ASX redirector
-		$::d_scan && msgf("scanWMA: Stream returned non-audio content-type: $type, treating as ASX redirector\n");
-		
-		# Re-fetch as a playlist.
-		$args->{'playlist'} = Slim::Schema->rs('Playlist')->objectForUrl({
-			'url' => $args->{'url'},
-		});
-		$args->{'playlist'}->content_type('asx');
-		$args->{'playlist'}->update;
-		
-		return scanPlaylist( $http->response->content_ref, $args );
+		# It's not audio, treat it as ASX playlist, but only if there are no other streams in the playlist
+		if ( scalar @{ $args->{'foundItems'} } == 1 ) {
+			$::d_scan && msgf("scanWMA: Stream returned non-audio content-type: $type, treating as ASX playlist\n");
+		
+			# Re-fetch as a playlist.
+			$args->{'playlist'} = Slim::Schema->rs('Playlist')->objectForUrl({
+				'url' => $args->{'url'},
+			});
+			$args->{'playlist'}->content_type('asx');
+			$args->{'playlist'}->update;
+		
+			scanPlaylist( $http->response->content_ref, $args );
+			
+			return;
+		}
+		else {
+			# Skip the stream with the bad content-type, and try the next stream
+			$::d_scan && msg("scanWMA: Stream returned non-audio content-type: $type, skipping to next stream\n");
+			
+			shift @{ $args->{'foundItems'} };
+			my $next = $args->{'foundItems'}->[0];
+			
+			scanWMAStream( {
+				'client'      => $args->{'client'},
+				'url'         => $next->url,
+				'callback'    => $args->{'callback'},
+				'passthrough' => $args->{'pt'},
+				'foundItems'  => $args->{'foundItems'},
+			} );
+			
+			return;
+		}
 	}
 	
 	# parse the ASF header data



More information about the checkins mailing list