Welcome! Log In Create A New Profile

Advanced

Re: [Patch] flv: add support for time offset

Jianyong Chen
August 12, 2019 10:02AM
> On Aug 12, 2019, at 7:06 PM, winshining <winshining@163.com> wrote:
>
> Hi, balus
> I think the second parameter of ngx_http_flv_read in ngx_http_flv_read_metadata and ngx_http_flv_read_tags is incorrect, it should be NGX_FLV_TAG_HEADER_SIZE.
> Besides, 'keyframes' is a non-standard object in metadata, there is no description about it in official tech document, you can refer to https://www.adobe.com/devnet/f4v.html https://www.adobe.com/devnet/f4v.html for details. Therefore, if a FLV file without the 'keyframes' object in metadata is played, the member 'times' of structure ngx_http_flv_file_t will be NULL, ngx_http_flv_timestamp_to_offset will crash then.
>
>
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel


Thanks for reading my code!

The first problem is a little confusing indeed. Notice that
NGX_FLV_HEADER_SIZE == NGX_FLV_TAG_HEADER_SIZE + NGX_FLV_PREV_TAG_SIZE,
and when I read a tag, I actually read tag_header + tag_data + prev_tag_size,
thus NGX_FLV_HEADER_SIZE is just what I need. Anyway, this is my fault, I
should have unified the two macros.

The second probelm has been carefully considered in the code. If there is no
‘keyframes’ object found in metadata, ngx_http_flv_parse_metadata() will return
NGX_DECLINED, which means to send the whole file, and therefore
ngx_http_flv_timestamp_to_offset() won’t be called and thus won’t crash.

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[Patch] flv: add support for time offset

Jianyong Chen 348 August 11, 2019 05:50AM

Re:[Patch] flv: add support for time offset

winshining 110 August 12, 2019 07:08AM

Re: [Patch] flv: add support for time offset

Jianyong Chen 101 August 12, 2019 10:02AM

Re: [Patch] flv: add support for time offset

Maxim Dounin 106 August 12, 2019 07:34AM

Re: [Patch] flv: add support for time offset

Jianyong Chen 131 August 12, 2019 11:12PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 293
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready