[FFmpeg-devel] [PATCH 3/3] lavf/dashdec: Add missed side data/disposition
Jun Zhao
mypopydev at gmail.com
Thu Jun 4 17:12:55 EEST 2020
From: Jun Zhao <barryjzhao at tencent.com>
dash demuxer get the strem info form sub-stream, but missed sida
data/disposition part, e,g, missed the DOVI sida data when the
stream is Dolby Vision streams
Signed-off-by: Jun Zhao <barryjzhao at tencent.com>
---
libavformat/dashdec.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index ec2aadc..694782c 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;
--
2.7.4
More information about the ffmpeg-devel
mailing list