# HG changeset patch # User Roman Arutyunyan # Date 1390988655 -14400 # Node ID 2f586f1684fa49c09d3367dc611abfa4cc2ec02c # Parent 5730c0193842dfb6bb30ca3d2401a7b36be12b4f 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. diff --git a/src/http/modules/ngx_http_mp4_module.c b/src/http/modules/ngx_http_mp4_module.c --- 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_m 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",