Commit c7360512 authored by Steven Liu's avatar Steven Liu

avformat/hlsenc: reindent hlsenc code

Signed-off-by: 's avatarSteven Liu <lq@onvideo.cn>
parent c52beb48
...@@ -1444,36 +1444,36 @@ static int hls_write_header(AVFormatContext *s) ...@@ -1444,36 +1444,36 @@ static int hls_write_header(AVFormatContext *s)
} }
if (hls->segment_type == SEGMENT_TYPE_FMP4) { if (hls->segment_type == SEGMENT_TYPE_FMP4) {
if (av_strcasecmp(hls->fmp4_init_filename, "init.mp4")) { if (av_strcasecmp(hls->fmp4_init_filename, "init.mp4")) {
hls->base_output_dirname = av_malloc(fmp4_init_filename_len); hls->base_output_dirname = av_malloc(fmp4_init_filename_len);
if (!hls->base_output_dirname) { if (!hls->base_output_dirname) {
ret = AVERROR(ENOMEM); ret = AVERROR(ENOMEM);
goto fail; goto fail;
} }
av_strlcpy(hls->base_output_dirname, hls->fmp4_init_filename, fmp4_init_filename_len); av_strlcpy(hls->base_output_dirname, hls->fmp4_init_filename, fmp4_init_filename_len);
} else {
if (basename_size > 0) {
hls->base_output_dirname = av_malloc(basename_size);
} else { } else {
hls->base_output_dirname = av_malloc(strlen(hls->fmp4_init_filename)); if (basename_size > 0) {
} hls->base_output_dirname = av_malloc(basename_size);
if (!hls->base_output_dirname) { } else {
ret = AVERROR(ENOMEM); hls->base_output_dirname = av_malloc(strlen(hls->fmp4_init_filename));
goto fail; }
} if (!hls->base_output_dirname) {
ret = AVERROR(ENOMEM);
goto fail;
}
if (basename_size > 0) { if (basename_size > 0) {
av_strlcpy(hls->base_output_dirname, s->filename, basename_size); av_strlcpy(hls->base_output_dirname, s->filename, basename_size);
p = strrchr(hls->base_output_dirname, '/'); p = strrchr(hls->base_output_dirname, '/');
} }
if (p) { if (p) {
*(p + 1) = '\0'; *(p + 1) = '\0';
av_strlcat(hls->base_output_dirname, hls->fmp4_init_filename, basename_size); av_strlcat(hls->base_output_dirname, hls->fmp4_init_filename, basename_size);
} else { } else {
av_strlcpy(hls->base_output_dirname, hls->fmp4_init_filename, fmp4_init_filename_len); av_strlcpy(hls->base_output_dirname, hls->fmp4_init_filename, fmp4_init_filename_len);
}
} }
} }
}
if (!hls->use_localtime) { if (!hls->use_localtime) {
ret = sls_flag_check_duration_size_index(hls); ret = sls_flag_check_duration_size_index(hls);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment