summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules/ngx_http_mp4_module.c
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2014-04-01 20:53:18 +0400
committerRoman Arutyunyan <arut@nginx.com>2014-04-01 20:53:18 +0400
commit5147f8ee6a5fb6a7cb615e0897e736a80daef9e8 (patch)
treedb4e2005984b8048f1a5f51d1ef8bcc65b9d4946 /src/http/modules/ngx_http_mp4_module.c
parent2349a6747d48a48cebcc5227f82083c33a799517 (diff)
downloadnginx-5147f8ee6a5fb6a7cb615e0897e736a80daef9e8.tar.gz
nginx-5147f8ee6a5fb6a7cb615e0897e736a80daef9e8.tar.bz2
Mp4: allow end values bigger than track duration.
If start time is within the track but end time is out of it, error "end time is out mp4 stts samples" is generated. However it's better to ignore the error and output the track until its end.
Diffstat (limited to 'src/http/modules/ngx_http_mp4_module.c')
-rw-r--r--src/http/modules/ngx_http_mp4_module.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/http/modules/ngx_http_mp4_module.c b/src/http/modules/ngx_http_mp4_module.c
index 9266e8c40..8f439ba92 100644
--- a/src/http/modules/ngx_http_mp4_module.c
+++ b/src/http/modules/ngx_http_mp4_module.c
@@ -2154,11 +2154,21 @@ ngx_http_mp4_crop_stts_data(ngx_http_mp4_file_t *mp4,
entry++;
}
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "%s time is out mp4 stts samples in \"%s\"",
- start ? "start" : "end", mp4->file.name.data);
+ if (start) {
+ ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
+ "start time is out mp4 stts samples in \"%s\"",
+ mp4->file.name.data);
- return NGX_ERROR;
+ return NGX_ERROR;
+
+ } else {
+ trak->end_sample = trak->start_sample + start_sample;
+
+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
+ "end_sample:%ui", trak->end_sample);
+
+ return NGX_OK;
+ }
found: