comparison src/http/modules/ngx_http_mp4_module.c @ 5622:a23c35496c2f

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.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 24 Mar 2014 17:55:10 +0400
parents 345e4fd4bb64
children c7bbc5fcf27c
comparison
equal deleted inserted replaced
5621:345e4fd4bb64 5622:a23c35496c2f
2271 } 2271 }
2272 2272
2273 ngx_http_mp4_crop_stss_data(mp4, trak, 1); 2273 ngx_http_mp4_crop_stss_data(mp4, trak, 1);
2274 ngx_http_mp4_crop_stss_data(mp4, trak, 0); 2274 ngx_http_mp4_crop_stss_data(mp4, trak, 0);
2275 2275
2276 entry = (uint32_t *) data->pos; 2276 if (trak->sync_samples_entries) {
2277 end = (uint32_t *) data->last; 2277 entry = (uint32_t *) data->pos;
2278 2278 end = (uint32_t *) data->last;
2279 start_sample = trak->start_sample; 2279
2280 2280 start_sample = trak->start_sample;
2281 while (entry < end) { 2281
2282 sample = ngx_mp4_get_32value(entry); 2282 while (entry < end) {
2283 sample -= start_sample; 2283 sample = ngx_mp4_get_32value(entry);
2284 ngx_mp4_set_32value(entry, sample); 2284 sample -= start_sample;
2285 entry++; 2285 ngx_mp4_set_32value(entry, sample);
2286 entry++;
2287 }
2288
2289 } else {
2290 trak->out[NGX_HTTP_MP4_STSS_DATA].buf = NULL;
2286 } 2291 }
2287 2292
2288 atom_size = sizeof(ngx_http_mp4_stss_atom_t) + (data->last - data->pos); 2293 atom_size = sizeof(ngx_http_mp4_stss_atom_t) + (data->last - data->pos);
2289 trak->size += atom_size; 2294 trak->size += atom_size;
2290 2295