diff options
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/hlsenc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 2271ced..d647554 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -2576,6 +2576,13 @@ static int hls_init(AVFormatContext *s) if (hls->segment_type == SEGMENT_TYPE_FMP4) { if (hls->nb_varstreams > 1) fmp4_init_filename_len += strlen(POSTFIX_PATTERN); + if (hls->flags & HLS_SINGLE_FILE) { + vs->fmp4_init_filename = av_strdup(vs->basename); + if (!vs->fmp4_init_filename) { + ret = AVERROR(ENOMEM); + goto fail; + } + } else { vs->fmp4_init_filename = av_malloc(fmp4_init_filename_len); if (!vs->fmp4_init_filename ) { ret = AVERROR(ENOMEM); @@ -2609,6 +2616,7 @@ static int hls_init(AVFormatContext *s) av_strlcpy(vs->base_output_dirname, vs->fmp4_init_filename, fmp4_init_filename_len); } + } } if (!hls->use_localtime) { @@ -2663,13 +2671,6 @@ static int hls_init(AVFormatContext *s) } } - if ((hls->flags & HLS_SINGLE_FILE) && (hls->segment_type == SEGMENT_TYPE_FMP4)) { - vs->fmp4_init_filename = av_strdup(vs->basename); - if (!vs->fmp4_init_filename) { - ret = AVERROR(ENOMEM); - goto fail; - } - } if ((ret = hls_mux_init(s, vs)) < 0) goto fail; |