Re: Slim::Music::Info::setDelayedCallback incorrect delay calc for 48000 sample rate
expectingtofly <expectingtofly.a9vthz-NUepA2SMhDQqspMVqqL2D+4xXEVPTSb/[email protected]>
| Newsgroups | gmane.music.equipment.slimdevices.devel |
|---|---|
| Organization | Logitech Squeezebox Forums |
| Message-ID | <[email protected]> |
philippe_44 wrote:
> >
Code:
--------------------
> >
> if ( $bitrate > 0 ) {
> my $decodeBuffer = $client->bufferFullness() / ( int($bitrate / 8) );
> my $outputBuffer = $client->outputBufferFullness() / (44100 * 8);
>
--------------------
> >
> bufferFullness and outputBufferFullness are the current level in bytes
> of the stream buffer and the decoded (raw) samples buffer
>
> So I agree that bufferfulness/(bitrate/8) gives a delay value, but
> outputBufferFullness / (44100 * 8) will not always make sense as it
> assumes outputbuffer has 8 bytes per frame, which is not always true.
> But still, using the samplerate when known is better, still :)
>
>
Ah, I guessed it was more complicated than it appeared :). Oh well,
I've submitted the pull request which removes the hard coding of sample
rate (if known), which, as you say, is an improvement at least. :)
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=115303