summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-sound/logitechmediaserver-bin/files/logitechmediaserver-bin-7.8.1_pre20140927-fix-transition-sample-rates2.patch')
-rw-r--r--media-sound/logitechmediaserver-bin/files/logitechmediaserver-bin-7.8.1_pre20140927-fix-transition-sample-rates2.patch167
1 files changed, 0 insertions, 167 deletions
diff --git a/media-sound/logitechmediaserver-bin/files/logitechmediaserver-bin-7.8.1_pre20140927-fix-transition-sample-rates2.patch b/media-sound/logitechmediaserver-bin/files/logitechmediaserver-bin-7.8.1_pre20140927-fix-transition-sample-rates2.patch
deleted file mode 100644
index b2d276b..0000000
--- a/media-sound/logitechmediaserver-bin/files/logitechmediaserver-bin-7.8.1_pre20140927-fix-transition-sample-rates2.patch
+++ /dev/null
@@ -1,167 +0,0 @@
---- Slim/Player/ReplayGain.pm.orig 2014-09-27 15:15:59.976908870 +0100
-+++ Slim/Player/ReplayGain.pm 2014-09-27 15:14:48.202343905 +0100
-@@ -74,10 +74,7 @@
- return preventClipping( $track->replay_gain(), $track->replay_peak() );
- }
-
--# Based on code from James Sutula's Dynamic Transition Updater plugin,
--# this method determines whether tracks at a given offset from each
--# other in the playlist are similarly adjacent within the same album.
--sub trackAlbumMatch {
-+sub findTracksByIndex {
- my $class = shift;
- my $client = shift;
- my $offset = shift;
-@@ -114,10 +111,24 @@
- # Get the track objects
- my $current_url = Slim::Player::Playlist::song($client, $current_index);
- my $current_track = Slim::Schema->objectForUrl({ 'url' => $current_url, 'create' => 1, 'readTags' => 1 });
--
-+
- my $compare_url = Slim::Player::Playlist::song($client, $compare_index);
- my $compare_track = Slim::Schema->objectForUrl({ 'url' => $compare_url, 'create' => 1, 'readTags' => 1 });
-
-+ return ($current_track, $compare_track);
-+}
-+
-+# Based on code from James Sutula's Dynamic Transition Updater plugin,
-+# this method determines whether tracks at a given offset from each
-+# other in the playlist are similarly adjacent within the same album.
-+sub trackAlbumMatch {
-+ my $class = shift;
-+ my $client = shift;
-+ my $offset = shift;
-+
-+ my ($current_track, $compare_track) = $class->findTracksByIndex($client, $offset);
-+ return if (!$current_track || !$compare_track);
-+
- if (!blessed($current_track) || !blessed($compare_track)) {
-
- logError("Couldn't find object for track: [$current_track] or [$compare_track] !");
-@@ -178,18 +189,88 @@
- return 0;
- }
-
-+# Identify whether the sample rates match between two tracks in a
-+# client playlist. This is modelled after the trackAlbumMatch function
-+# above.
-+sub trackSampleRateMatch {
-+ my $class = shift;
-+ my $client = shift;
-+ my $offset = shift;
-+
-+ my ($current_track, $compare_track) = $class->findTracksByIndex($client, $offset);
-+ return if (!$current_track || !$compare_track);
-+
-+ if (!blessed($current_track) || !blessed($compare_track)) {
-+
-+ logError("Couldn't find object for track: [$current_track] or [$compare_track] !");
-+
-+ return 0;
-+ }
-+
-+ if (!$current_track->can('samplerate') || !$compare_track->can('samplerate')) {
-+
-+ logError("Couldn't a find valid object for track: [$current_track] or [$compare_track] !");
-+
-+ return 0;
-+ }
-+
-+ # For remote tracks, get metadata from the protocol handler
-+ if ( $current_track->remote ) {
-+ if ( !$compare_track->remote ) {
-+ # Other track is not remote, fail
-+ return;
-+ }
-+
-+ my $current_meta = {};
-+ my $compare_meta = {};
-+
-+ my $current_handler = Slim::Player::ProtocolHandlers->handlerForURL( $current_track->url );
-+ my $compare_handler = Slim::Player::ProtocolHandlers->handlerForURL( $compare_track->url );
-+
-+ if ( $current_handler && $current_handler->can('getMetadataFor') ) {
-+ $current_meta = $current_handler->getMetadataFor( $client, $current_track->url );
-+ }
-+
-+ if ( $compare_handler && $compare_handler->can('getMetadataFor') ) {
-+ $compare_meta = $compare_handler->getMetadataFor( $client, $compare_track->url );
-+ }
-+
-+ if ( $current_meta->{samplerate}
-+ && $compare_meta->{samplerate}
-+ && $current_meta->{samplerate} eq $compare_meta->{samplerate}
-+ ) {
-+ # Sample rate metadata matches
-+ return 1;
-+ }
-+ else {
-+ return;
-+ }
-+ }
-+
-+ # Check sample rates match
-+ my $compare_rate = $compare_track->samplerate;
-+ my $current_rate = $current_track->samplerate;
-+ if ($compare_rate && $current_rate &&
-+ ($compare_rate == $current_rate)) {
-+
-+ return 1;
-+ }
-+
-+ return 0;
-+}
-+
- # Bug 5119
- # Reduce the gain value if necessary to avoid clipping
- sub preventClipping {
- my ( $gain, $peak ) = @_;
--
-+
- if ( defined $peak && defined $gain && $peak > 0 ) {
- my $noclip = -20 * ( log($peak) / log(10) );
- if ( $noclip < $gain ) {
- return $noclip;
- }
- }
--
-+
- return $gain;
- }
-
---- Slim/Player/Squeezebox.pm.orig 2014-09-27 15:15:55.008731322 +0100
-+++ Slim/Player/Squeezebox.pm 2014-09-27 15:15:24.451639324 +0100
-@@ -994,19 +994,30 @@
- }
- }
-
-+ # Don't do transitions if the sample rates of the two
-+ # songs differ. This avoids some unpleasant white
-+ # noise from (at least) the Squeezebox Touch when
-+ # using the analogue outputs. This might be bug#1884.
-+ if (!Slim::Player::ReplayGain->trackSampleRateMatch($master, -1)
-+ ||
-+ !Slim::Player::ReplayGain->trackSampleRateMatch($master, 1)) {
-+ main::INFOLOG && $log->info('Overriding transition due to differing sample rates');
-+ $transitionType = 0;
-+ }
-+
- }
--
-+
- if ($transitionDuration > $client->maxTransitionDuration()) {
- $transitionDuration = $client->maxTransitionDuration();
- }
--
-+
- if ( main::INFOLOG && $log->is_info ) {
- $log->info(sprintf(
- "Starting decoder with format: %s flags: 0x%x autostart: %s buffer threshold: %s output threshold: %s samplesize: %s samplerate: %s endian: %s channels: %s",
- $formatbyte, $flags, $autostart, $bufferThreshold, $outputThreshold, $pcmsamplesize, $pcmsamplerate, $pcmendian, $pcmchannels,
- ));
- }
--
-+
- my $frame = pack 'aaaaaaaCCCaCCCNnN', (
- 's', # command
- $autostart,