aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergey Kandaurov <pluknet@nginx.com>2014-03-24 17:55:10 +0400
committerSergey Kandaurov <pluknet@nginx.com>2014-03-24 17:55:10 +0400
commit2070abf51678acda21b57ea6bb99c640be65474c (patch)
tree18301d1d46102bd32345203cde4e778e9bb9b66f /src
parenteffbf466aa44df725a9f68761b2793065bba6756 (diff)
downloadnginx-2070abf51678acda21b57ea6bb99c640be65474c.tar.gz
nginx-2070abf51678acda21b57ea6bb99c640be65474c.zip
Mp4: skipped empty stss atom table in output.
The atom may have no data entries after cropping. This fixes "zero size buf in output" alerts.
Diffstat (limited to 'src')
-rw-r--r--src/http/modules/ngx_http_mp4_module.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/http/modules/ngx_http_mp4_module.c b/src/http/modules/ngx_http_mp4_module.c
index d0a6a8e03..c9b67adca 100644
--- a/src/http/modules/ngx_http_mp4_module.c
+++ b/src/http/modules/ngx_http_mp4_module.c
@@ -2273,16 +2273,21 @@ ngx_http_mp4_update_stss_atom(ngx_http_mp4_file_t *mp4,
ngx_http_mp4_crop_stss_data(mp4, trak, 1);
ngx_http_mp4_crop_stss_data(mp4, trak, 0);
- entry = (uint32_t *) data->pos;
- end = (uint32_t *) data->last;
+ if (trak->sync_samples_entries) {
+ entry = (uint32_t *) data->pos;
+ end = (uint32_t *) data->last;
- start_sample = trak->start_sample;
+ start_sample = trak->start_sample;
- while (entry < end) {
- sample = ngx_mp4_get_32value(entry);
- sample -= start_sample;
- ngx_mp4_set_32value(entry, sample);
- entry++;
+ while (entry < end) {
+ sample = ngx_mp4_get_32value(entry);
+ sample -= start_sample;
+ ngx_mp4_set_32value(entry, sample);
+ entry++;
+ }
+
+ } else {
+ trak->out[NGX_HTTP_MP4_STSS_DATA].buf = NULL;
}
atom_size = sizeof(ngx_http_mp4_stss_atom_t) + (data->last - data->pos);