mirror of
https://github.com/zotanmew/nginx-rtmp-module.git
synced 2024-06-26 15:28:58 +02:00
fixed time formatting & file op error code check
This commit is contained in:
parent
c928742cb9
commit
43718388f4
|
@ -340,7 +340,7 @@ ngx_rtmp_dash_write_playlist(ngx_rtmp_session_t *s)
|
||||||
ngx_rtmp_dash_get_frag(s, 0)->timestamp / 1000, &tm);
|
ngx_rtmp_dash_get_frag(s, 0)->timestamp / 1000, &tm);
|
||||||
|
|
||||||
*ngx_sprintf(start_time, "%4d-%02d-%02dT%02d:%02d:%02d%c%02d:%02d",
|
*ngx_sprintf(start_time, "%4d-%02d-%02dT%02d:%02d:%02d%c%02d:%02d",
|
||||||
tm.tm_year, tm.tm_mon,
|
tm.tm_year + 1900, tm.tm_mon + 1,
|
||||||
tm.tm_mday, tm.tm_hour,
|
tm.tm_mday, tm.tm_hour,
|
||||||
tm.tm_min, tm.tm_sec,
|
tm.tm_min, tm.tm_sec,
|
||||||
ctx->start_time.gmtoff < 0 ? '-' : '+',
|
ctx->start_time.gmtoff < 0 ? '-' : '+',
|
||||||
|
@ -353,7 +353,7 @@ ngx_rtmp_dash_write_playlist(ngx_rtmp_session_t *s)
|
||||||
1000, &tm);
|
1000, &tm);
|
||||||
|
|
||||||
*ngx_sprintf(end_time, "%4d-%02d-%02dT%02d:%02d:%02d%c%02d:%02d",
|
*ngx_sprintf(end_time, "%4d-%02d-%02dT%02d:%02d:%02d%c%02d:%02d",
|
||||||
tm.tm_year, tm.tm_mon,
|
tm.tm_year + 1900, tm.tm_mon + 1,
|
||||||
tm.tm_mday, tm.tm_hour,
|
tm.tm_mday, tm.tm_hour,
|
||||||
tm.tm_min, tm.tm_sec,
|
tm.tm_min, tm.tm_sec,
|
||||||
ctx->start_time.gmtoff < 0 ? '-' : '+',
|
ctx->start_time.gmtoff < 0 ? '-' : '+',
|
||||||
|
|
|
@ -315,7 +315,7 @@ ngx_rtmp_hls_create_parent_dir(ngx_rtmp_session_t *s)
|
||||||
|
|
||||||
*ngx_snprintf(path, sizeof(path) - 1, "%V", &hacf->path) = 0;
|
*ngx_snprintf(path, sizeof(path) - 1, "%V", &hacf->path) = 0;
|
||||||
|
|
||||||
if (ngx_create_dir(path, NGX_RTMP_HLS_DIR_ACCESS) != NGX_OK) {
|
if (ngx_create_dir(path, NGX_RTMP_HLS_DIR_ACCESS) == NGX_FILE_ERROR) {
|
||||||
err = ngx_errno;
|
err = ngx_errno;
|
||||||
if (err != NGX_EEXIST) {
|
if (err != NGX_EEXIST) {
|
||||||
ngx_log_error(NGX_LOG_ERR, s->connection->log, err,
|
ngx_log_error(NGX_LOG_ERR, s->connection->log, err,
|
||||||
|
@ -342,7 +342,7 @@ ngx_rtmp_hls_create_parent_dir(ngx_rtmp_session_t *s)
|
||||||
ngx_log_debug1(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
|
ngx_log_debug1(NGX_LOG_DEBUG_RTMP, s->connection->log, 0,
|
||||||
"hls: creating nested folder: '%s'", path);
|
"hls: creating nested folder: '%s'", path);
|
||||||
|
|
||||||
if (ngx_create_dir(path, NGX_RTMP_HLS_DIR_ACCESS) != NGX_OK) {
|
if (ngx_create_dir(path, NGX_RTMP_HLS_DIR_ACCESS) == NGX_FILE_ERROR) {
|
||||||
ngx_log_error(NGX_LOG_ERR, s->connection->log, ngx_errno,
|
ngx_log_error(NGX_LOG_ERR, s->connection->log, ngx_errno,
|
||||||
"hls: error creating nested folder: '%s'", path);
|
"hls: error creating nested folder: '%s'", path);
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
|
|
Loading…
Reference in a new issue