Mercurial > hg > nginx-quic
comparison src/http/modules/ngx_http_mp4_module.c @ 5629:c7bbc5fcf27c
Mp4: fixed seeking to a track end.
When "start" value is equal to a track duration the request
fails with "time is out mp4 stts" like it did before track
duration check was added. Now such tracks are considered
short and skipped.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Mon, 31 Mar 2014 19:52:17 +0400 |
parents | a23c35496c2f |
children | 02584b335727 |
comparison
equal
deleted
inserted
replaced
5628:a24f88eff684 | 5629:c7bbc5fcf27c |
---|---|
1505 "tkhd duration:%uL, time:%.3fs", | 1505 "tkhd duration:%uL, time:%.3fs", |
1506 duration, (double) duration / mp4->timescale); | 1506 duration, (double) duration / mp4->timescale); |
1507 | 1507 |
1508 start_time = (uint64_t) mp4->start * mp4->timescale / 1000; | 1508 start_time = (uint64_t) mp4->start * mp4->timescale / 1000; |
1509 | 1509 |
1510 if (duration < start_time) { | 1510 if (duration <= start_time) { |
1511 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, | 1511 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, |
1512 "tkhd duration is less than start time"); | 1512 "tkhd duration is less than start time"); |
1513 return NGX_DECLINED; | 1513 return NGX_DECLINED; |
1514 } | 1514 } |
1515 | 1515 |
1666 "mdhd timescale:%uD, duration:%uL, time:%.3fs", | 1666 "mdhd timescale:%uD, duration:%uL, time:%.3fs", |
1667 timescale, duration, (double) duration / timescale); | 1667 timescale, duration, (double) duration / timescale); |
1668 | 1668 |
1669 start_time = (uint64_t) mp4->start * timescale / 1000; | 1669 start_time = (uint64_t) mp4->start * timescale / 1000; |
1670 | 1670 |
1671 if (duration < start_time) { | 1671 if (duration <= start_time) { |
1672 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, | 1672 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, |
1673 "mdhd duration is less than start time"); | 1673 "mdhd duration is less than start time"); |
1674 return NGX_DECLINED; | 1674 return NGX_DECLINED; |
1675 } | 1675 } |
1676 | 1676 |