From d3e0bf306b86ac08b828886e75b8c30218a16377 Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Wed, 29 Jan 2014 13:44:15 +0400 Subject: [PATCH] Mp4: fix seeks to standalone last chunk. If seek position is within the last track chunk and that chunk is standalone (stsc entry describes only this chunk) such seek generates stsc seek error. The problem is that chunk numbers start with 1, not with 0. --- src/http/modules/ngx_http_mp4_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http/modules/ngx_http_mp4_module.c b/src/http/modules/ngx_http_mp4_module.c index 9fe88ecce..c29ab1ce5 100644 --- a/src/http/modules/ngx_http_mp4_module.c +++ b/src/http/modules/ngx_http_mp4_module.c @@ -2494,7 +2494,7 @@ ngx_http_mp4_update_stsc_atom(ngx_http_mp4_file_t *mp4, entry++; } - next_chunk = trak->chunks; + next_chunk = trak->chunks + 1; ngx_log_debug4(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "start_sample:%uD, chunk:%uD, chunks:%uD, samples:%uD",