summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2012-02-05 15:51:20 +0000
committerMaxim Dounin <mdounin@mdounin.ru>2012-02-05 15:51:20 +0000
commitff8c2aedfee6514ba50391dcf5fef5bd02016684 (patch)
tree448f1ea335b83266b4509288615baea05194bfee
parentd7ccc61da1513f51c4067928d736630415e75afe (diff)
downloadnginx-ff8c2aedfee6514ba50391dcf5fef5bd02016684.tar.gz
nginx-ff8c2aedfee6514ba50391dcf5fef5bd02016684.tar.bz2
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).
-rw-r--r--src/http/modules/ngx_http_mp4_module.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/http/modules/ngx_http_mp4_module.c b/src/http/modules/ngx_http_mp4_module.c
index 3c9f88cfc..6de7c8fea 100644
--- a/src/http/modules/ngx_http_mp4_module.c
+++ b/src/http/modules/ngx_http_mp4_module.c
@@ -165,10 +165,10 @@ typedef struct {
((u_char *) (p))[7] = n4
#define ngx_mp4_get_32value(p) \
- ( (((u_char *) (p))[0] << 24) \
- + (((u_char *) (p))[1] << 16) \
- + (((u_char *) (p))[2] << 8) \
- + (((u_char *) (p))[3]) )
+ ( ((uint32_t) ((u_char *) (p))[0] << 24) \
+ + ( ((u_char *) (p))[1] << 16) \
+ + ( ((u_char *) (p))[2] << 8) \
+ + ( ((u_char *) (p))[3]) )
#define ngx_mp4_set_32value(p, n) \
((u_char *) (p))[0] = (u_char) ((n) >> 24); \
@@ -2382,6 +2382,8 @@ found:
data->pos = (u_char *) entry;
atom_size = sizeof(ngx_mp4_stsc_atom_t) + (data->last - data->pos);
+ ngx_mp4_set_32value(entry->chunk, 1);
+
if (trak->chunk_samples) {
first = &trak->stsc_chunk_entry;