diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2012-06-18 14:02:20 +0000 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2012-06-18 14:02:20 +0000 |
commit | 859dc4ce015b8706d569350034f04c174cad479d (patch) | |
tree | 7f195986d6882ab79af468b4a002c58068d907c9 /src | |
parent | e1e2e2eb3a987de63efedc55f0abcda384d7eccc (diff) | |
download | nginx-859dc4ce015b8706d569350034f04c174cad479d.tar.gz nginx-859dc4ce015b8706d569350034f04c174cad479d.zip |
Mp4: fixed streaming if moov atom is at buffer edge.
Diffstat (limited to 'src')
-rw-r--r-- | src/http/modules/ngx_http_mp4_module.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_mp4_module.c b/src/http/modules/ngx_http_mp4_module.c index 80c7ed853..eb51ab2dc 100644 --- a/src/http/modules/ngx_http_mp4_module.c +++ b/src/http/modules/ngx_http_mp4_module.c @@ -1024,6 +1024,10 @@ ngx_http_mp4_read_moov_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size) + NGX_HTTP_MP4_MOOV_BUFFER_EXCESS * no_mdat; } + if (ngx_http_mp4_read(mp4, atom_data_size) != NGX_OK) { + return NGX_ERROR; + } + mp4->trak.elts = &mp4->traks; mp4->trak.size = sizeof(ngx_http_mp4_trak_t); mp4->trak.nalloc = 2; @@ -1044,6 +1048,12 @@ ngx_http_mp4_read_moov_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size) mp4->buffer_start = mp4->buffer_pos; mp4->buffer_size = NGX_HTTP_MP4_MOOV_BUFFER_EXCESS; + if (mp4->buffer_start + mp4->buffer_size > mp4->buffer_end) { + mp4->buffer = NULL; + mp4->buffer_pos = NULL; + mp4->buffer_end = NULL; + } + } else { /* skip atoms after moov atom */ mp4->offset = mp4->end; |