comparison src/http/modules/ngx_http_mp4_module.c @ 5638:0c0dd1aacdf5

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.
author Roman Arutyunyan <arut@nginx.com>
date Tue, 01 Apr 2014 20:53:18 +0400
parents 02584b335727
children 6d468b45f40e
comparison
equal deleted inserted replaced
5637:5a65b9d8bc2b 5638:0c0dd1aacdf5
2152 start_time -= count * duration; 2152 start_time -= count * duration;
2153 entries--; 2153 entries--;
2154 entry++; 2154 entry++;
2155 } 2155 }
2156 2156
2157 ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0, 2157 if (start) {
2158 "%s time is out mp4 stts samples in \"%s\"", 2158 ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
2159 start ? "start" : "end", mp4->file.name.data); 2159 "start time is out mp4 stts samples in \"%s\"",
2160 2160 mp4->file.name.data);
2161 return NGX_ERROR; 2161
2162 return NGX_ERROR;
2163
2164 } else {
2165 trak->end_sample = trak->start_sample + start_sample;
2166
2167 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
2168 "end_sample:%ui", trak->end_sample);
2169
2170 return NGX_OK;
2171 }
2162 2172
2163 found: 2173 found:
2164 2174
2165 if (start) { 2175 if (start) {
2166 ngx_mp4_set_32value(entry->count, count - rest); 2176 ngx_mp4_set_32value(entry->count, count - rest);