comparison src/http/modules/ngx_http_mp4_module.c @ 678:981b4c44593b NGINX_1_3_2

nginx 1.3.2 *) Change: the "single" parameter of the "keepalive" directive is now ignored. *) Change: SSL compression is now disabled when using all versions of OpenSSL, including ones prior to 1.0.0. *) Feature: it is now possible to use the "ip_hash" directive to balance IPv6 clients. *) Feature: the $status variable can now be used not only in the "log_format" directive. *) Bugfix: a segmentation fault might occur in a worker process on shutdown if the "resolver" directive was used. *) Bugfix: a segmentation fault might occur in a worker process if the ngx_http_mp4_module was used. *) Bugfix: in the ngx_http_mp4_module. *) Bugfix: a segmentation fault might occur in a worker process if conflicting wildcard server names were used. *) Bugfix: nginx might be terminated abnormally on a SIGBUS signal on ARM platform. *) Bugfix: an alert "sendmsg() failed (9: Bad file number)" on HP-UX while reconfiguration.
author Igor Sysoev <http://sysoev.ru>
date Tue, 26 Jun 2012 00:00:00 +0400
parents 4dcaf40cc702
children 597573166f34
comparison
equal deleted inserted replaced
677:47f0934d8824 678:981b4c44593b
1022 1022
1023 mp4->buffer_size = (size_t) atom_data_size 1023 mp4->buffer_size = (size_t) atom_data_size
1024 + NGX_HTTP_MP4_MOOV_BUFFER_EXCESS * no_mdat; 1024 + NGX_HTTP_MP4_MOOV_BUFFER_EXCESS * no_mdat;
1025 } 1025 }
1026 1026
1027 if (ngx_http_mp4_read(mp4, (size_t) atom_data_size) != NGX_OK) {
1028 return NGX_ERROR;
1029 }
1030
1027 mp4->trak.elts = &mp4->traks; 1031 mp4->trak.elts = &mp4->traks;
1028 mp4->trak.size = sizeof(ngx_http_mp4_trak_t); 1032 mp4->trak.size = sizeof(ngx_http_mp4_trak_t);
1029 mp4->trak.nalloc = 2; 1033 mp4->trak.nalloc = 2;
1030 mp4->trak.pool = mp4->request->pool; 1034 mp4->trak.pool = mp4->request->pool;
1031 1035
1041 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 moov atom done"); 1045 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 moov atom done");
1042 1046
1043 if (no_mdat) { 1047 if (no_mdat) {
1044 mp4->buffer_start = mp4->buffer_pos; 1048 mp4->buffer_start = mp4->buffer_pos;
1045 mp4->buffer_size = NGX_HTTP_MP4_MOOV_BUFFER_EXCESS; 1049 mp4->buffer_size = NGX_HTTP_MP4_MOOV_BUFFER_EXCESS;
1050
1051 if (mp4->buffer_start + mp4->buffer_size > mp4->buffer_end) {
1052 mp4->buffer = NULL;
1053 mp4->buffer_pos = NULL;
1054 mp4->buffer_end = NULL;
1055 }
1046 1056
1047 } else { 1057 } else {
1048 /* skip atoms after moov atom */ 1058 /* skip atoms after moov atom */
1049 mp4->offset = mp4->end; 1059 mp4->offset = mp4->end;
1050 } 1060 }
2486 data->pos = (u_char *) entry; 2496 data->pos = (u_char *) entry;
2487 atom_size = sizeof(ngx_mp4_stsc_atom_t) + (data->last - data->pos); 2497 atom_size = sizeof(ngx_mp4_stsc_atom_t) + (data->last - data->pos);
2488 2498
2489 ngx_mp4_set_32value(entry->chunk, 1); 2499 ngx_mp4_set_32value(entry->chunk, 1);
2490 2500
2491 if (trak->chunk_samples) { 2501 if (trak->chunk_samples && next_chunk - trak->start_chunk == 2) {
2502
2503 /* last chunk in the entry */
2504
2505 ngx_mp4_set_32value(entry->samples, samples - trak->chunk_samples);
2506
2507 } else if (trak->chunk_samples) {
2492 2508
2493 first = &trak->stsc_chunk_entry; 2509 first = &trak->stsc_chunk_entry;
2494 ngx_mp4_set_32value(first->chunk, 1); 2510 ngx_mp4_set_32value(first->chunk, 1);
2495 ngx_mp4_set_32value(first->samples, samples - trak->chunk_samples); 2511 ngx_mp4_set_32value(first->samples, samples - trak->chunk_samples);
2496 ngx_mp4_set_32value(first->id, id); 2512 ngx_mp4_set_32value(first->id, id);
2502 2518
2503 trak->out[NGX_HTTP_MP4_STSC_CHUNK].buf = buf; 2519 trak->out[NGX_HTTP_MP4_STSC_CHUNK].buf = buf;
2504 2520
2505 ngx_mp4_set_32value(entry->chunk, 2); 2521 ngx_mp4_set_32value(entry->chunk, 2);
2506 2522
2523 entries++;
2507 atom_size += sizeof(ngx_mp4_stsc_entry_t); 2524 atom_size += sizeof(ngx_mp4_stsc_entry_t);
2508 } 2525 }
2509 2526
2510 while (++entry < end) { 2527 while (++entry < end) {
2511 chunk = ngx_mp4_get_32value(entry->chunk); 2528 chunk = ngx_mp4_get_32value(entry->chunk);