[patch][bugfix]Http mp4: replace strtod() with improved ngx_atofp() because precision problem.

胡聪 (hucc) hucong.c at foxmail.com
Wed Oct 26 16:40:21 UTC 2016


Hello!

On Wed, Oct 26, 2016 at 8:31PM, Maxim Dounin wrote:

>On Wed, Oct 26, 2016 at 05:10:25PM +0800, 胡聪 (hucc) wrote:
> 
>> VOD (video on demand) module which support requesting time range
>> also need the special function, so i would like to see that nginx-devel
>> add a function in Core, that would be helpful. Possible patch below.
>
>If you mean https://github.com/kaltura/nginx-vod-module, then I 
>don't think it does.  Quick look suggests that it uses 
>milliseconds to specify times instead, and uses ngx_atoi() to 
>parse them.  It doesn't use strtod() at all, and the only place it 
>uses ngx_atofp() now is to parse rate, and I don't think there are 
>reasons to allow arbitrary numbers like in the mp4 case.
>
>The main problem with mp4 was that there were existing Flash 
>clients nginx has to be compatible with, and some of them used to 
>send incorrect start time specifications.  It is highly unlikely 
>that the same unique situation affects other modules.

I don`t know how to make a more specific description because of my
poor english.  What i mean about VOD is video-processing module in
CDN provider, this scenario usually be asked to provide parameter
parsing which support seconds and milliseconds.  I am developing a
series of moudles which are a bit like nginx-vod-module and new
function will be used based on my experience.  I just think the usage
of atofp() is very limited, maybe a function supporting optional mode
should be provided.  Anyway, the point is whether other modules
need new function, i pointed out the scene i familiar with and hope
this helps.


Regards,
-hucc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20161027/09248619/attachment.html>


More information about the nginx-devel mailing list