[bugfix] Mp4: fixed start time is out mp4 mdat atom.
胡聪 (hucc)
hucong.c at foxmail.com
Mon Mar 27 16:50:45 UTC 2017
Hi,
On Monday, Mar 27, 2017 11:39 PM +0300, Maxim Dounin wrote:
>On Mon, Mar 27, 2017 at 10:57:51PM +0800, 胡聪 (hucc) wrote:
>
>> # HG changeset patch
>> # User hucongcong <hucong.c at foxmail.com>
>> # Date 1490619789 -28800
>> # Mon Mar 27 21:03:09 2017 +0800
>> # Node ID 67ad0b01f77ea5590d390b4b38d71ec2c739d333
>> # Parent 22be63bf21edaa1b8ea916c7d8cd4e5fe4892061
>> Mp4: fixed start time is out mp4 mdat atom.
>>
>> start time is already out mp4 mdat atom when start_offset is equal to
>> file_last of mdat.
>>
>> diff -r 22be63bf21ed -r 67ad0b01f77e src/http/modules/ngx_http_mp4_module.c
>> --- a/src/http/modules/ngx_http_mp4_module.c Fri Mar 24 18:05:06 2017 +0300
>> +++ b/src/http/modules/ngx_http_mp4_module.c Mon Mar 27 21:03:09 2017 +0800
>> @@ -860,7 +860,7 @@ ngx_http_mp4_process(ngx_http_mp4_file_t
>>
>> *prev = &mp4->mdat_atom;
>>
>> - if (start_offset > mp4->mdat_data.buf->file_last) {
>> + if (start_offset >= mp4->mdat_data.buf->file_last) {
>> ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
>> "start time is out mp4 mdat atom in \"%s\"",
>> mp4->file.name.data);
>
>Please explain what exactly you are trying to fix here.
>
>If start_offset == file_last, the file can still contain a
>zero-sized mdat atom. Such atom is unlikely to be usable, but it
>looks still legitimate from formal point of view.
Yes, it is still legitimate. But here start_offset is indeed out of mdat atom.
This is an issue of the accuracy of the boundary control. Understanding this
error will become easier if someone want this module to support returning
integral file when ngx_http_mp4_process() returns NGX_ERROR.
Best wishes
-hucc
More information about the nginx-devel
mailing list