@@ -794,6 +794,9 @@ files.
@item http_user_agent
Override User-Agent field in HTTP header. Applicable only for HTTP output.
+@item http_persistent
+Use persistent HTTP connections. Applicable only for HTTP output.
+
@end table
@anchor{ico}
@@ -175,6 +175,7 @@ typedef struct HLSContext {
double initial_prog_date_time;
char current_segment_final_filename_fmt[1024]; // when renaming segments
char *user_agent;
+ int http_persistent;
} HLSContext;
static int get_int_from_double(double val)
@@ -228,7 +229,8 @@ static void set_http_options(AVFormatContext *s, AVDictionary **options, HLSCont
}
if (c->user_agent)
av_dict_set(options, "user_agent", c->user_agent, 0);
-
+ if (c->http_persistent)
+ av_dict_set_int(options, "multiple_requests", c->http_persistent, 0);
}
static int replace_int_data_in_filename(char *buf, int buf_size, const char *filename, char placeholder, int64_t number)
@@ -1829,6 +1831,7 @@ static const AVOption options[] = {
{"epoch", "seconds since epoch", 0, AV_OPT_TYPE_CONST, {.i64 = HLS_START_SEQUENCE_AS_SECONDS_SINCE_EPOCH }, INT_MIN, INT_MAX, E, "start_sequence_source_type" },
{"datetime", "current datetime as YYYYMMDDhhmmss", 0, AV_OPT_TYPE_CONST, {.i64 = HLS_START_SEQUENCE_AS_FORMATTED_DATETIME }, INT_MIN, INT_MAX, E, "start_sequence_source_type" },
{"http_user_agent", "override User-Agent field in HTTP header", OFFSET(user_agent), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E},
+ {"http_persistent", "Use persistent HTTP connections", OFFSET(http_persistent), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, E },
{ NULL },
};