avformat/hlsenc: fix write wrong init file URI string problem
authorSteven Liu <lq@chinaffmpeg.org>
Sun, 18 Mar 2018 06:07:00 +0000 (14:07 +0800)
committerSteven Liu <lq@chinaffmpeg.org>
Sun, 18 Mar 2018 11:05:05 +0000 (19:05 +0800)
fmp4_init_filename should append after base_output_dirname

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
libavformat/hlsenc.c

index 58d403d..3df0784 100644 (file)
@@ -2583,21 +2583,6 @@ static int hls_init(AVFormatContext *s)
             }
             av_strlcpy(vs->fmp4_init_filename, hls->fmp4_init_filename,
                        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) {
                     ret = append_postfix(vs->fmp4_init_filename, fmp4_init_filename_len, i);
                     if (ret < 0)
@@ -2624,7 +2609,6 @@ static int hls_init(AVFormatContext *s)
                     av_strlcpy(vs->base_output_dirname, vs->fmp4_init_filename,
                                fmp4_init_filename_len);
                 }
-            }
         }
 
         if (!hls->use_localtime) {