diff options
author | Igor Sysoev <igor@sysoev.ru> | 2011-11-14 18:42:48 +0400 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2011-11-14 18:42:48 +0400 |
commit | dd4490c4e44955819c00d4024cb8e724fc6f2ff4 (patch) | |
tree | 9da830f31c4d4338eac48908d0ab1b7ea1de5252 | |
parent | 3db91b8c730ddfd762c03a367285d6a9da1ec44a (diff) |
Fix of "Content-Length" header of MP4 response if start argument was used.
Patch by Piotr Sikora.
-rw-r--r-- | src/http/modules/ngx_http_mp4_module.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/http/modules/ngx_http_mp4_module.c b/src/http/modules/ngx_http_mp4_module.c index a6752123a..a4a47ee8e 100644 --- a/src/http/modules/ngx_http_mp4_module.c +++ b/src/http/modules/ngx_http_mp4_module.c @@ -1066,7 +1066,6 @@ ngx_http_mp4_update_mdat_atom(ngx_http_mp4_file_t *mp4, off_t start_offset) atom_data_size = mp4->mdat_data.buf->file_last - start_offset; mp4->mdat_data.buf->file_pos = start_offset; - mp4->content_length += atom_data_size; ngx_log_debug2(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mdat new offset @%O:%O", start_offset, atom_data_size); @@ -1083,6 +1082,8 @@ ngx_http_mp4_update_mdat_atom(ngx_http_mp4_file_t *mp4, off_t start_offset) atom_header_size = sizeof(ngx_mp4_atom_header_t); } + mp4->content_length += atom_header_size + atom_data_size; + ngx_mp4_set_32value(atom_header, atom_size); ngx_mp4_set_atom_name(atom_header, 'm', 'd', 'a', 't'); |