sle118 wrote: 
> The main difference here is that sorry does not really stream as such.
> Typical streaming send data in small chunks (think of live radio). In a
> fast connection, spotty gets files downloaded on a matter of seconds.
> This causes buffers to fill up with parts of a track only. When the
> client buffers need data, the wdt has already killed the socket and so
> the stream runs dry.

Still doesn't really explain why spotty break while "Listen
again"/podcast which download huge chunks of data at a time until all
buffers in players & intermediates are full, and as player plays & asks
for more, it is trickled through  - this doesn't cause watchdog timeout.

> Setting spotty as local would disable the wdt, which will resolve my
> issue.
Not easy to do without changing lots of LMS code or Spotty plugin having
Pipeline code like AlienBBC which played RealAudio - used to have .
The code below is old and out of date however  since it starts with
"*use base qw(Slim::Player::Pipeline);*" and 
and then the "*my $self = $class->SUPER::new(undef, $command);*"  in
current LMS could have a "local" param.



Code:
--------------------
    
  package Plugins::Alien::RTSP;
  
  use strict;
  
  use base qw(Slim::Player::Pipeline);
  
  use Slim::Utils::Strings qw(string);
  use Slim::Utils::Misc;
  use Slim::Utils::Log;
  use Slim::Utils::Prefs;
  
  use Plugins::Alien::RTSPScanHeaders;
  
  my $log = logger('plugin.alienbbc');
  
  Slim::Player::ProtocolHandlers->registerHandler('rtsp', __PACKAGE__);
  
  Slim::Formats::Playlists->registerParser('rtsppl', 
'Plugins::Alien::Playlists::RTSPPL');
  Slim::Formats::Playlists->registerParser('smilpl', 
'Plugins::Alien::Playlists::SMIL');
  
  
  sub new {
        my $class = shift;
        my $args = shift;
  
        my $url    = $args->{'url'};
        my $client = $args->{'client'};
        my $seekdata = $client->scanData->{seekdata} ;
        my $rtspmetadata = $client->scanData->{rtspmetadata} ;
  
        # Check client - only stream to known slim clients
        if (!defined($client) || !$client->isPlayer()) {
  
                $log->warn("Alien only streams to Slim players");
  
                return undef;
        }
  
        Slim::Music::Info::setContentType($url, 'rtsp');
  
        my $track    = Slim::Schema->rs('Track')->objectForUrl({
                'url'      => $url,
                'readTags' => 1
        });
        $client->pluginData( currentTrack => $track );
  
  
  
  # RTSP URL headers are scanned but it usually completes after "new" is called 
except when a Seek hgas been done
  # then the RTSP URL is nOT scanned and so we need to use RTSP metadata  
  
        if ( $rtspmetadata->{scannedurl} eq $url) {
                if ( defined ($rtspmetadata->{'endtime'})) {
                  $client->streamingProgressBar( {
                                'url'     => $url,
                                'bitrate' => $rtspmetadata->{'avgbitrate'} ,
                                'duration'=> 
int($rtspmetadata->{'endtime'}/1000),
                  } );
                };
        }
  
  
        my ($command, $type, $format) = 
Slim::Player::TranscodingHelper::getConvertCommand($client, $url);
  
        unless (defined($command) && $command ne '-') {
  
                $log->warn("Couldn't find conversion command for $url");
  
                Slim::Player::Source::errorOpening($client, 
string('PLUGIN_ALIENBBC_NO_CONVERT_CMD'));
  
                return undef;
        }
  
        $log->info("$url, $format");
  
  #     Slim::Music::Info::setContentType($url, $format);
  
        my $maxRate = 0;
        my $quality = 1;
  
        if (defined($client)) {
                $maxRate = Slim::Utils::Prefs::maxRate($client);
                $quality = 
preferences('server')->client($client)->get('lameQuality');
        }
  
        if (defined ($seekdata->{newtime})) {
                my $newtime = int($seekdata->{newtime});
  
                if ( $url =~ m"\Artsp://(.+)(\.ra\?|\.rm\?)"){
                        if ($url =~m/((\?start=)|(\&start=))/ ) {
                                $url =~ m/\A(.+)start=[\d:\."]+(.*)\z/;
                        $url = $1 . "start=$newtime" . $2;
                        } 
                        else {
                                $url .= "&start=" . $newtime;
                        }
                } 
                else {
                        $url .= "?start=" . $newtime;
                }
  
                $client->masterOrSelf->currentsongqueue()->[-1]->{startOffset} 
= $newtime;
                $client->masterOrSelf->remoteStreamStartTime( 
Time::HiRes::time() - $newtime );
                
                # Remove seek data
                delete $client->scanData->{seekdata};
        }
  
        $log->debug("Modified url to play $url");
  
        $command = 
Slim::Player::TranscodingHelper::tokenizeConvertCommand($command, $type, $url, 
$url, 0, $maxRate, 1, $quality);
  
        my $self = $class->SUPER::new(undef, $command);
  
        ${*$self}{'contentType'} = $format;
  
        return $self;
  }
  .
  .
  .
  
  
--------------------


------------------------------------------------------------------------
bpa's Profile: http://forums.slimdevices.com/member.php?userid=1806
View this thread: http://forums.slimdevices.com/showthread.php?t=110455

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to