comparison src/http/modules/ngx_http_mp4_module.c @ 4155:d9636bf3f159

Fix of building on platforms with 32-bit off_t. (closed #23)
author Igor Sysoev <igor@sysoev.ru>
date Thu, 29 Sep 2011 15:19:36 +0000
parents bc0ca958c270
children 67a4654ba7d9
comparison
equal deleted inserted replaced
4154:57d45d345651 4155:d9636bf3f159
185 + ( ((u_char *) (p))[5] << 16) \ 185 + ( ((u_char *) (p))[5] << 16) \
186 + ( ((u_char *) (p))[6] << 8) \ 186 + ( ((u_char *) (p))[6] << 8) \
187 + ( ((u_char *) (p))[7]) ) 187 + ( ((u_char *) (p))[7]) )
188 188
189 #define ngx_mp4_set_64value(p, n) \ 189 #define ngx_mp4_set_64value(p, n) \
190 ((u_char *) (p))[0] = (u_char) ((n) >> 56); \ 190 ((u_char *) (p))[0] = (u_char) ((uint64_t) (n) >> 56); \
191 ((u_char *) (p))[1] = (u_char) ((n) >> 48); \ 191 ((u_char *) (p))[1] = (u_char) ((uint64_t) (n) >> 48); \
192 ((u_char *) (p))[2] = (u_char) ((n) >> 40); \ 192 ((u_char *) (p))[2] = (u_char) ((uint64_t) (n) >> 40); \
193 ((u_char *) (p))[3] = (u_char) ((n) >> 32); \ 193 ((u_char *) (p))[3] = (u_char) ((uint64_t) (n) >> 32); \
194 ((u_char *) (p))[4] = (u_char) ((n) >> 24); \ 194 ((u_char *) (p))[4] = (u_char) ( (n) >> 24); \
195 ((u_char *) (p))[5] = (u_char) ((n) >> 16); \ 195 ((u_char *) (p))[5] = (u_char) ( (n) >> 16); \
196 ((u_char *) (p))[6] = (u_char) ((n) >> 8); \ 196 ((u_char *) (p))[6] = (u_char) ( (n) >> 8); \
197 ((u_char *) (p))[7] = (u_char) (n) 197 ((u_char *) (p))[7] = (u_char) (n)
198 198
199 #define ngx_mp4_last_trak(mp4) \ 199 #define ngx_mp4_last_trak(mp4) \
200 &((ngx_http_mp4_trak_t *) mp4->trak.elts)[mp4->trak.nelts - 1] 200 &((ngx_http_mp4_trak_t *) mp4->trak.elts)[mp4->trak.nelts - 1]
201 201
202 202
1064 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, 1064 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
1065 "mdat new offset @%O:%O", start_offset, atom_data_size); 1065 "mdat new offset @%O:%O", start_offset, atom_data_size);
1066 1066
1067 atom_header = mp4->mdat_atom_header; 1067 atom_header = mp4->mdat_atom_header;
1068 1068
1069 if (atom_data_size > 0xffffffff) { 1069 if ((uint64_t) atom_data_size > 0xffffffff) {
1070 atom_size = 1; 1070 atom_size = 1;
1071 atom_header_size = sizeof(ngx_mp4_atom_header64_t); 1071 atom_header_size = sizeof(ngx_mp4_atom_header64_t);
1072 ngx_mp4_set_64value(atom_header + sizeof(ngx_mp4_atom_header_t), 1072 ngx_mp4_set_64value(atom_header + sizeof(ngx_mp4_atom_header_t),
1073 sizeof(ngx_mp4_atom_header64_t) + atom_data_size); 1073 sizeof(ngx_mp4_atom_header64_t) + atom_data_size);
1074 } else { 1074 } else {