summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorSteven Liu <lq@chinaffmpeg.org>2019-01-19 14:59:44 +0800
committerSteven Liu <lq@chinaffmpeg.org>2019-02-10 14:45:43 +0800
commit9ec1f7634a621b0fda6d814f730c270c6e22b251 (patch)
tree99f907e31bb5ae50befba8983d4eaa315ee537a1 /libavformat
parenta03885b745be6ba324f0b24668c8e338d8b1e54c (diff)
avformat/hlsenc: fix fmp4_init_filename file name with %v problem
when set option fmp4_init_filename to init_%v.mp4 before patch: the init file will be init_%v_0.mp4, init_%v_1.mp4 after patch: the init file will be init_0.mp4, init_1.mp4 Reported-By: Gyan Doshi <ffmpeg@gyani.pro> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/hlsenc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index d91960d752..258d0628ba 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2740,7 +2740,11 @@ static int hls_init(AVFormatContext *s)
av_strlcpy(vs->fmp4_init_filename, hls->fmp4_init_filename,
fmp4_init_filename_len);
if (hls->nb_varstreams > 1) {
- ret = append_postfix(vs->fmp4_init_filename, fmp4_init_filename_len, i);
+ if (av_stristr(vs->fmp4_init_filename, "%v")) {
+ format_name(vs->fmp4_init_filename, fmp4_init_filename_len, i);
+ } else {
+ ret = append_postfix(vs->fmp4_init_filename, fmp4_init_filename_len, i);
+ }
if (ret < 0)
goto fail;
}