Commit a92ca3c0 authored by Steven Liu's avatar Steven Liu

avformat/hlsenc: fix write wrong init file URI string problem

fmp4_init_filename should append after base_output_dirname
Signed-off-by: 's avatarSteven Liu <lq@chinaffmpeg.org>
parent 08e0f45c
...@@ -2583,21 +2583,6 @@ static int hls_init(AVFormatContext *s) ...@@ -2583,21 +2583,6 @@ static int hls_init(AVFormatContext *s)
} }
av_strlcpy(vs->fmp4_init_filename, hls->fmp4_init_filename, av_strlcpy(vs->fmp4_init_filename, hls->fmp4_init_filename,
fmp4_init_filename_len); fmp4_init_filename_len);
if (av_strcasecmp(hls->fmp4_init_filename, "init.mp4")) {
ret = format_name(vs->fmp4_init_filename, fmp4_init_filename_len, i);
if (ret < 0)
goto fail;
fmp4_init_filename_len = strlen(vs->fmp4_init_filename) + 1;
vs->base_output_dirname = av_malloc(fmp4_init_filename_len);
if (!vs->base_output_dirname) {
ret = AVERROR(ENOMEM);
goto fail;
}
av_strlcpy(vs->base_output_dirname, vs->fmp4_init_filename,
fmp4_init_filename_len);
} else {
if (hls->nb_varstreams > 1) { if (hls->nb_varstreams > 1) {
ret = append_postfix(vs->fmp4_init_filename, fmp4_init_filename_len, i); ret = append_postfix(vs->fmp4_init_filename, fmp4_init_filename_len, i);
if (ret < 0) if (ret < 0)
...@@ -2625,7 +2610,6 @@ static int hls_init(AVFormatContext *s) ...@@ -2625,7 +2610,6 @@ static int hls_init(AVFormatContext *s)
fmp4_init_filename_len); 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