]> git.kaiwu.me - nginx.git/commitdiff
Mp4: fix seeks to standalone last chunk.
authorRoman Arutyunyan <arut@nginx.com>
Wed, 29 Jan 2014 09:44:15 +0000 (13:44 +0400)
committerRoman Arutyunyan <arut@nginx.com>
Wed, 29 Jan 2014 09:44:15 +0000 (13:44 +0400)
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

index 9fe88eccec2a22d4b5aeabfef71268ecbfc1690f..c29ab1ce544c18476d767a427d138a2b3cba1a40 100644 (file)
@@ -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",