comparison src/http/modules/ngx_http_mp4_module.c @ 4089:e27670e1ab70

mp4_max_moov_size directive has been renamed to mp4_max_buffer_size.
author Igor Sysoev <igor@sysoev.ru>
date Mon, 12 Sep 2011 09:38:04 +0000
parents 8fe1da7b8386
children 28859c50233f
comparison
equal deleted inserted replaced
4088:8fe1da7b8386 4089:e27670e1ab70
35 #define NGX_HTTP_MP4_LAST_ATOM NGX_HTTP_MP4_STCO_DATA 35 #define NGX_HTTP_MP4_LAST_ATOM NGX_HTTP_MP4_STCO_DATA
36 36
37 37
38 typedef struct { 38 typedef struct {
39 size_t buffer_size; 39 size_t buffer_size;
40 size_t max_moov_size; 40 size_t max_buffer_size;
41 } ngx_http_mp4_conf_t; 41 } ngx_http_mp4_conf_t;
42 42
43 43
44 typedef struct { 44 typedef struct {
45 uint32_t timescale; 45 uint32_t timescale;
273 ngx_conf_set_size_slot, 273 ngx_conf_set_size_slot,
274 NGX_HTTP_LOC_CONF_OFFSET, 274 NGX_HTTP_LOC_CONF_OFFSET,
275 offsetof(ngx_http_mp4_conf_t, buffer_size), 275 offsetof(ngx_http_mp4_conf_t, buffer_size),
276 NULL }, 276 NULL },
277 277
278 { ngx_string("mp4_max_moov_size"), 278 { ngx_string("mp4_max_buffer_size"),
279 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1, 279 NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
280 ngx_conf_set_size_slot, 280 ngx_conf_set_size_slot,
281 NGX_HTTP_LOC_CONF_OFFSET, 281 NGX_HTTP_LOC_CONF_OFFSET,
282 offsetof(ngx_http_mp4_conf_t, max_moov_size), 282 offsetof(ngx_http_mp4_conf_t, max_buffer_size),
283 NULL }, 283 NULL },
284 284
285 ngx_null_command 285 ngx_null_command
286 }; 286 };
287 287
935 935
936 conf = ngx_http_get_module_loc_conf(mp4->request, ngx_http_mp4_module); 936 conf = ngx_http_get_module_loc_conf(mp4->request, ngx_http_mp4_module);
937 937
938 if (atom_data_size > mp4->buffer_size) { 938 if (atom_data_size > mp4->buffer_size) {
939 939
940 if (atom_data_size > conf->max_moov_size) { 940 if (atom_data_size > conf->max_buffer_size) {
941 ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0, 941 ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
942 "\"%s\" mp4 moov atom is too large:%uL, " 942 "\"%s\" mp4 moov atom is too large:%uL, "
943 "you may want to increase mp4_max_moov_size", 943 "you may want to increase mp4_max_buffer_size",
944 mp4->file.name.data, atom_data_size); 944 mp4->file.name.data, atom_data_size);
945 return NGX_ERROR; 945 return NGX_ERROR;
946 } 946 }
947 947
948 ngx_pfree(mp4->request->pool, mp4->buffer); 948 ngx_pfree(mp4->request->pool, mp4->buffer);
2572 if (conf == NULL) { 2572 if (conf == NULL) {
2573 return NULL; 2573 return NULL;
2574 } 2574 }
2575 2575
2576 conf->buffer_size = NGX_CONF_UNSET_SIZE; 2576 conf->buffer_size = NGX_CONF_UNSET_SIZE;
2577 conf->max_moov_size = NGX_CONF_UNSET_SIZE; 2577 conf->max_buffer_size = NGX_CONF_UNSET_SIZE;
2578 2578
2579 return conf; 2579 return conf;
2580 } 2580 }
2581 2581
2582 2582
2585 { 2585 {
2586 ngx_http_mp4_conf_t *prev = parent; 2586 ngx_http_mp4_conf_t *prev = parent;
2587 ngx_http_mp4_conf_t *conf = child; 2587 ngx_http_mp4_conf_t *conf = child;
2588 2588
2589 ngx_conf_merge_size_value(conf->buffer_size, prev->buffer_size, 512 * 1024); 2589 ngx_conf_merge_size_value(conf->buffer_size, prev->buffer_size, 512 * 1024);
2590 ngx_conf_merge_size_value(conf->max_moov_size, prev->max_moov_size, 2590 ngx_conf_merge_size_value(conf->max_buffer_size, prev->max_buffer_size,
2591 10 * 1024 * 1024); 2591 10 * 1024 * 1024);
2592 2592
2593 return NGX_CONF_OK; 2593 return NGX_CONF_OK;
2594 } 2594 }