@@ -183,6 +183,7 @@ typedef struct VariantStream {
const char *sgroup; /* subtitle group name */
const char *ccgroup; /* closed caption group name */
const char *varname; /* variant name */
+ int bandwidth; /* bandwidth for the variant */
} VariantStream;
typedef struct ClosedCaptionsStream {
@@ -1492,6 +1493,10 @@ static int create_master_playlist(AVFormatContext *s,
bandwidth += get_stream_bit_rate(aud_st);
bandwidth += bandwidth / 10;
+ if (vs->bandwidth){
+ bandwidth = vs->bandwidth;
+ }
+
ccgroup = NULL;
if (vid_st && vs->ccgroup) {
/* check if this group name is available in the cc map string */
@@ -2088,6 +2093,9 @@ static int parse_variant_stream_mapstring(AVFormatContext *s)
(!av_strncasecmp(val, "1", strlen("1"))));
hls->has_default_key = 1;
continue;
+ } else if (av_strstart(keyval, "bandwidth:", &val)) {
+ vs->bandwidth = strtoimax(val, NULL, 10);
+ continue;
} else if (av_strstart(keyval, "name:", &val)) {
vs->varname = val;
continue;