Skip to content

Commit 69c090d

Browse files
committed
renamed directives
1 parent 2f82fa2 commit 69c090d

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

hls/ngx_rtmp_hls_module.c

+24-24
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ typedef struct {
111111
ngx_str_t base_url;
112112
ngx_int_t granularity;
113113
ngx_flag_t keys;
114-
ngx_str_t keys_path;
115-
ngx_str_t keys_url;
114+
ngx_str_t key_path;
115+
ngx_str_t key_url;
116116
ngx_int_t frags_per_key;
117117
} ngx_rtmp_hls_app_conf_t;
118118

@@ -287,18 +287,18 @@ static ngx_command_t ngx_rtmp_hls_commands[] = {
287287
offsetof(ngx_rtmp_hls_app_conf_t, keys),
288288
NULL },
289289

290-
{ ngx_string("hls_keys_path"),
290+
{ ngx_string("hls_key_path"),
291291
NGX_RTMP_MAIN_CONF|NGX_RTMP_SRV_CONF|NGX_RTMP_APP_CONF|NGX_CONF_TAKE1,
292292
ngx_conf_set_str_slot,
293293
NGX_RTMP_APP_CONF_OFFSET,
294-
offsetof(ngx_rtmp_hls_app_conf_t, keys_path),
294+
offsetof(ngx_rtmp_hls_app_conf_t, key_path),
295295
NULL },
296296

297-
{ ngx_string("hls_keys_url"),
297+
{ ngx_string("hls_key_url"),
298298
NGX_RTMP_MAIN_CONF|NGX_RTMP_SRV_CONF|NGX_RTMP_APP_CONF|NGX_CONF_TAKE1,
299299
ngx_conf_set_str_slot,
300300
NGX_RTMP_APP_CONF_OFFSET,
301-
offsetof(ngx_rtmp_hls_app_conf_t, keys_url),
301+
offsetof(ngx_rtmp_hls_app_conf_t, key_url),
302302
NULL },
303303

304304
{ ngx_string("hls_fragments_per_key"),
@@ -541,15 +541,15 @@ ngx_rtmp_hls_write_playlist(ngx_rtmp_session_t *s)
541541
}
542542

543543
sep = hacf->nested ? (hacf->base_url.len ? "/" : "") : "-";
544-
key_sep = hacf->nested ? (hacf->keys_url.len ? "/" : "") : "-";
544+
key_sep = hacf->nested ? (hacf->key_url.len ? "/" : "") : "-";
545545

546546
name_part.len = 0;
547547
if (!hacf->nested || hacf->base_url.len) {
548548
name_part = ctx->name;
549549
}
550550

551551
key_name_part.len = 0;
552-
if (!hacf->nested || hacf->keys_url.len) {
552+
if (!hacf->nested || hacf->key_url.len) {
553553
key_name_part = ctx->name;
554554
}
555555

@@ -568,7 +568,7 @@ ngx_rtmp_hls_write_playlist(ngx_rtmp_session_t *s)
568568
if (hacf->keys && (i == 0 || f->key_id != prev_key_id)) {
569569
p = ngx_slprintf(p, end, "#EXT-X-KEY:METHOD=AES-128,"
570570
"URI=\"%V%V%s%uL.key\",IV=0x%032XL\n",
571-
&hacf->keys_url, &key_name_part,
571+
&hacf->key_url, &key_name_part,
572572
key_sep, f->key_id, f->key_id);
573573
}
574574

@@ -864,7 +864,7 @@ ngx_rtmp_hls_open_fragment(ngx_rtmp_session_t *s, uint64_t ts,
864864
}
865865

866866
if (hacf->keys &&
867-
ngx_rtmp_hls_ensure_directory(s, &hacf->keys_path) != NGX_OK)
867+
ngx_rtmp_hls_ensure_directory(s, &hacf->key_path) != NGX_OK)
868868
{
869869
return NGX_ERROR;
870870
}
@@ -1397,16 +1397,16 @@ ngx_rtmp_hls_publish(ngx_rtmp_session_t *s, ngx_rtmp_publish_t *v)
13971397
/* key path */
13981398

13991399
if (hacf->keys) {
1400-
len = hacf->keys_path.len + 1 + ctx->name.len + NGX_INT64_LEN
1400+
len = hacf->key_path.len + 1 + ctx->name.len + NGX_INT64_LEN
14011401
+ sizeof(".key");
14021402

14031403
ctx->keyfile.data = ngx_palloc(s->connection->pool, len);
14041404
if (ctx->keyfile.data == NULL) {
14051405
return NGX_ERROR;
14061406
}
14071407

1408-
p = ngx_cpymem(ctx->keyfile.data, hacf->keys_path.data,
1409-
hacf->keys_path.len);
1408+
p = ngx_cpymem(ctx->keyfile.data, hacf->key_path.data,
1409+
hacf->key_path.len);
14101410

14111411
if (p[-1] != '/') {
14121412
*p++ = '/';
@@ -2294,8 +2294,8 @@ ngx_rtmp_hls_merge_app_conf(ngx_conf_t *cf, void *parent, void *child)
22942294
ngx_conf_merge_str_value(conf->base_url, prev->base_url, "");
22952295
ngx_conf_merge_value(conf->granularity, prev->granularity, 0);
22962296
ngx_conf_merge_value(conf->keys, prev->keys, 0);
2297-
ngx_conf_merge_str_value(conf->keys_path, prev->keys_path, "");
2298-
ngx_conf_merge_str_value(conf->keys_url, prev->keys_url, "");
2297+
ngx_conf_merge_str_value(conf->key_path, prev->key_path, "");
2298+
ngx_conf_merge_str_value(conf->key_url, prev->key_url, "");
22992299
ngx_conf_merge_value(conf->frags_per_key, prev->frags_per_key, 0);
23002300

23012301
if (conf->fraglen) {
@@ -2337,20 +2337,20 @@ ngx_rtmp_hls_merge_app_conf(ngx_conf_t *cf, void *parent, void *child)
23372337

23382338
ngx_conf_merge_str_value(conf->path, prev->path, "");
23392339

2340-
if (conf->keys && conf->cleanup && conf->keys_path.len &&
2341-
ngx_strcmp(conf->keys_path.data, conf->path.data) != 0 &&
2340+
if (conf->keys && conf->cleanup && conf->key_path.len &&
2341+
ngx_strcmp(conf->key_path.data, conf->path.data) != 0 &&
23422342
conf->type != NGX_RTMP_HLS_TYPE_EVENT)
23432343
{
2344-
if (conf->keys_path.data[conf->keys_path.len - 1] == '/') {
2345-
conf->keys_path.len--;
2344+
if (conf->key_path.data[conf->key_path.len - 1] == '/') {
2345+
conf->key_path.len--;
23462346
}
23472347

23482348
cleanup = ngx_pcalloc(cf->pool, sizeof(*cleanup));
23492349
if (cleanup == NULL) {
23502350
return NGX_CONF_ERROR;
23512351
}
23522352

2353-
cleanup->path = conf->keys_path;
2353+
cleanup->path = conf->key_path;
23542354
cleanup->playlen = conf->playlen;
23552355

23562356
conf->slot = ngx_pcalloc(cf->pool, sizeof(*conf->slot));
@@ -2359,7 +2359,7 @@ ngx_rtmp_hls_merge_app_conf(ngx_conf_t *cf, void *parent, void *child)
23592359
}
23602360

23612361
conf->slot->manager = ngx_rtmp_hls_cleanup;
2362-
conf->slot->name = conf->keys_path;
2362+
conf->slot->name = conf->key_path;
23632363
conf->slot->data = cleanup;
23642364
conf->slot->conf_file = cf->conf_file->file.name.data;
23652365
conf->slot->line = cf->conf_file->line;
@@ -2369,10 +2369,10 @@ ngx_rtmp_hls_merge_app_conf(ngx_conf_t *cf, void *parent, void *child)
23692369
}
23702370
}
23712371

2372-
ngx_conf_merge_str_value(conf->keys_path, prev->keys_path, "");
2372+
ngx_conf_merge_str_value(conf->key_path, prev->key_path, "");
23732373

2374-
if (conf->keys_path.len == 0) {
2375-
conf->keys_path = conf->path;
2374+
if (conf->key_path.len == 0) {
2375+
conf->key_path = conf->path;
23762376
}
23772377

23782378
return NGX_CONF_OK;

0 commit comments

Comments
 (0)