[FFmpeg-devel] [PATCH] avformat/hlsenc: removed specific filename format code for non-zero segment sizes

Stephen Dawkins stephen.dawkins at gmail.com
Sun Nov 11 14:00:06 EET 2018


This patch removes some duplicate code in hls_start that prevents the usage
of strftime base filenames in conjuction with hls_segment_size.

Signed-off-by: Stephen Dawkins <stephen.dawkins at gmail.com>
---
 libavformat/hlsenc.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index f8f060d065..4557951f0b 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -1468,19 +1468,6 @@ static int hls_start(AVFormatContext *s, VariantStream *vs)
                 return AVERROR(ENOMEM);
             ff_format_set_url(vtt_oc, new_name);
         }
-    } else if (c->max_seg_size > 0) {
-        char *filename = NULL;
-        if (replace_int_data_in_filename(&filename,
-#if FF_API_HLS_WRAP
-            vs->basename, 'd', c->wrap ? vs->sequence % c->wrap : vs->sequence) < 1) {
-#else
-            vs->basename, 'd', vs->sequence) < 1) {
-#endif
-                av_free(filename);
-                av_log(oc, AV_LOG_ERROR, "Invalid segment filename template '%s', you can try to use -strftime 1 with it\n", vs->basename);
-                return AVERROR(EINVAL);
-        }
-        ff_format_set_url(oc, filename);
     } else {
         if (c->use_localtime) {
             time_t now0;
-- 
2.19.1



More information about the ffmpeg-devel mailing list