|
|
|
@@ -364,6 +364,9 @@ typedef struct MatroskaDemuxContext { |
|
|
|
|
|
|
|
/* WebM DASH Manifest live flag/ */ |
|
|
|
int is_live; |
|
|
|
|
|
|
|
/* Bandwidth value for WebM DASH Manifest */ |
|
|
|
int bandwidth; |
|
|
|
} MatroskaDemuxContext; |
|
|
|
|
|
|
|
typedef struct MatroskaBlock { |
|
|
|
@@ -3912,7 +3915,20 @@ static int webm_dash_manifest_read_header(AVFormatContext *s) |
|
|
|
av_dict_set_int(&s->streams[0]->metadata, TRACK_NUMBER, tracks[0].num, 0); |
|
|
|
|
|
|
|
// parse the cues and populate Cue related fields |
|
|
|
return matroska->is_live ? 0 : webm_dash_manifest_cues(s); |
|
|
|
if (!matroska->is_live) { |
|
|
|
ret = webm_dash_manifest_cues(s); |
|
|
|
if (ret < 0) { |
|
|
|
av_log(s, AV_LOG_ERROR, "Error parsing Cues\n"); |
|
|
|
return ret; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// use the bandwidth from the command line if it was provided |
|
|
|
if (matroska->bandwidth > 0) { |
|
|
|
av_dict_set_int(&s->streams[0]->metadata, BANDWIDTH, |
|
|
|
matroska->bandwidth, 0); |
|
|
|
} |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
static int webm_dash_manifest_read_packet(AVFormatContext *s, AVPacket *pkt) |
|
|
|
@@ -3923,6 +3939,7 @@ static int webm_dash_manifest_read_packet(AVFormatContext *s, AVPacket *pkt) |
|
|
|
#define OFFSET(x) offsetof(MatroskaDemuxContext, x) |
|
|
|
static const AVOption options[] = { |
|
|
|
{ "live", "flag indicating that the input is a live file that only has the headers.", OFFSET(is_live), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM }, |
|
|
|
{ "bandwidth", "bandwidth of this stream to be specified in the DASH manifest.", OFFSET(bandwidth), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM }, |
|
|
|
{ NULL }, |
|
|
|
}; |
|
|
|
|
|
|
|
|