[nginx] Mp4: fix seeks after the last key frame.

Roman Arutyunyan arut at nginx.com
Wed Jan 29 09:32:13 UTC 2014


details:   http://hg.nginx.org/nginx/rev/847c308917af
branches:  
changeset: 5542:847c308917af
user:      Roman Arutyunyan <arut at nginx.com>
date:      Wed Jan 29 13:30:36 2014 +0400
description:
Mp4: fix seeks after the last key frame.

Mp4 module does not allow seeks after the last key frame.  Since
stss atom only contains key frames it's usually shorter than
other track atoms.  That leads to stss seek error when seek
position is close to the end of file.  The fix outputs empty
stss frame instead of generating error.

diffstat:

 src/http/modules/ngx_http_mp4_module.c |  7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diffs (17 lines):

diff -r fdb67cfc957d -r 847c308917af src/http/modules/ngx_http_mp4_module.c
--- a/src/http/modules/ngx_http_mp4_module.c	Tue Jan 28 15:40:46 2014 +0400
+++ b/src/http/modules/ngx_http_mp4_module.c	Wed Jan 29 13:30:36 2014 +0400
@@ -2153,11 +2153,8 @@ ngx_http_mp4_update_stss_atom(ngx_http_m
         entry++;
     }
 
-    ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
-                  "start sample is out of mp4 stss atom in \"%s\"",
-                  mp4->file.name.data);
-
-    return NGX_ERROR;
+    ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
+                   "start sample is out of mp4 stss atom");
 
 found:
 



More information about the nginx-devel mailing list