diff options
author | Jun Zhao <barryjzhao@tencent.com> | 2020-06-04 22:00:48 +0800 |
---|---|---|
committer | Jun Zhao <barryjzhao@tencent.com> | 2020-06-18 17:51:41 +0800 |
commit | 3cf2f515e392ab22594f34966e93e75931cfc7e2 (patch) | |
tree | 7bb6fae319219a8ff47c88bef72971addbd50538 /libavformat/dashdec.c | |
parent | b7f3a7c439885945af697580a0c08c0573f8885b (diff) |
lavf/dashdec: Add missed side data/disposition
dash demuxer get the stream info from sub-stream, but missed side
data/disposition part, e,g, missed the DOVI side data when the
stream is Dolby Vision streams
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Diffstat (limited to 'libavformat/dashdec.c')
-rw-r--r-- | libavformat/dashdec.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index ec2aadcee3..694782c820 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -2001,6 +2001,20 @@ static int open_demux_for_component(AVFormatContext *s, struct representation *p st->id = i; avcodec_parameters_copy(st->codecpar, ist->codecpar); avpriv_set_pts_info(st, ist->pts_wrap_bits, ist->time_base.num, ist->time_base.den); + + // copy disposition + st->disposition = ist->disposition; + + // copy side data + for (int i = 0; i < ist->nb_side_data; i++) { + const AVPacketSideData *sd_src = &ist->side_data[i]; + uint8_t *dst_data; + + dst_data = av_stream_new_side_data(st, sd_src->type, sd_src->size); + if (!dst_data) + return AVERROR(ENOMEM); + memcpy(dst_data, sd_src->data, sd_src->size); + } } return 0; |