Merge of r4383, r4403:
MP4 fixes:
*) Fixed mp4 if first entry in stsc was skipped (ticket #72).
If first entry in stsc atom was skipped, and seek was to chunk
boundary, than first_chunk in the generated stsc table wasn't
set to 1.
*) Fixed handling of mp4 above 2G and 32bit offsets (ticket #84).
Maxim Dounin
8 years ago
164 | 164 | ((u_char *) (p))[7] = n4 |
165 | 165 | |
166 | 166 | #define ngx_mp4_get_32value(p) \ |
167 | ( (((u_char *) (p))[0] << 24) \ | |
168 | + (((u_char *) (p))[1] << 16) \ | |
169 | + (((u_char *) (p))[2] << 8) \ | |
170 | + (((u_char *) (p))[3]) ) | |
167 | ( ((uint32_t) ((u_char *) (p))[0] << 24) \ | |
168 | + ( ((u_char *) (p))[1] << 16) \ | |
169 | + ( ((u_char *) (p))[2] << 8) \ | |
170 | + ( ((u_char *) (p))[3]) ) | |
171 | 171 | |
172 | 172 | #define ngx_mp4_set_32value(p, n) \ |
173 | 173 | ((u_char *) (p))[0] = (u_char) ((n) >> 24); \ |
2381 | 2381 | data->pos = (u_char *) entry; |
2382 | 2382 | atom_size = sizeof(ngx_mp4_stsc_atom_t) + (data->last - data->pos); |
2383 | 2383 | |
2384 | ngx_mp4_set_32value(entry->chunk, 1); | |
2385 | ||
2384 | 2386 | if (trak->chunk_samples) { |
2385 | 2387 | |
2386 | 2388 | first = &trak->stsc_chunk_entry; |