philippe_44 wrote: 
> That would explain b/c the request range last byte is 
> > 
Code:
--------------------
  >   > 
  > $track->audio_offset + $track->audio_size - 1 if $track->audio_size;
  > 
--------------------
> > 
> On purpose, it is not the content_length in the server response b/c a
> file might have all sort of trailing crap. Now, if there is an issue
> on the server and they have a wrong mp4 header, the track's audio_size
> might be incorrect and I'll shoot beyong the content_length. I can
> harden that a bit and take the smallest of contentLength (if any) and
> $track->audio_offset + $track->audio_size

Thank you for the explanation.   I'm a bit confused how that all works
on a variable bit rate file.  Take this example where we are having the
problem :

The (verified) content length is : 

Code:
--------------------
    
  "content-length"            => 64_062_386,
    
Code:
--------------------
        
    
    LMS reads the MP4 headers as such :
        
Code:
--------------------
            
      my $a = {
      audio_offset      => 931_526,
      audio_size        => 63_180_833,
      avg_bitrate       => 46_792,
      compatible_brands => ["isom", "M4A ", "mp42"],
      dlna_profile      => "AAC_ISO_192",
      fh                => bless(\*File::Temp::$fh, "File::Temp"),
      file_size         => 931_542,
      jenkins_hash      => "1280117999",
      major_brand       => "M4A ",
      minor_version     => 1,
      mv_timescale      => 600,
      processors        => { aac => sub { "???" } },
      samplerate        => 22_050,
      song_length_ms    => 10_800_020,
      tracks            => [
      {
      audio_object_type => 2,
      audio_type        => 64,
      bits_per_sample   => 16,
      channels          => 2,
      duration          => 10_800_020,
      encoding          => "mp4a",
      handler_name      => "SoundHandler",
      handler_type      => "soun",
      id                => 1,
      max_bitrate       => 51_944,
      samplerate        => 22_050,
      },
      ],
      };
      
--------------------
        
    
    So, 931526 + 63180833 = 64,112,359  which is obviously greater than size of 
the file.  Which is why we are getting the Range error.
    
    But how does it work out the audio size?   Does the average bit rate come 
from the Mp4 header or is it worked out from a sample?    If it's the latter 
would that be accurate enough to be used for the Range calculation?



Stuart McLean   

EXPECTINGTOFLY PLUGINS :
    
- *BBC Sounds* : 
  https://github.com/expectingtofly/LMS_BBC_Sounds_Plugin 
- *Virgin Radio (UK)* : 
  https://github.com/expectingtofly/LMS_Virgin_Radio_Plugin 
- *Times Radio* : 
  https://github.com/expectingtofly/LMS_TIMES_RADIO_PLUGIN 
- *Global Player (UK)* : 
  https://github.com/expectingtofly/LMS_GlobalPlayer_Plugin 
  
For BBC Sounds help see the 'BBC Sounds Wiki'
(https://github.com/expectingtofly/LMS_BBC_Sounds_Plugin/wiki).
------------------------------------------------------------------------
expectingtofly's Profile: http://forums.slimdevices.com/member.php?userid=63263
View this thread: http://forums.slimdevices.com/showthread.php?t=115070

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

Reply via email to