diff options
author | vacingfang <vacingfang@tencent.com> | 2020-06-04 21:59:43 +0800 |
---|---|---|
committer | Jun Zhao <barryjzhao@tencent.com> | 2020-06-18 17:51:10 +0800 |
commit | b7f3a7c439885945af697580a0c08c0573f8885b (patch) | |
tree | d589748b7d2876c65f708a9a95e8b5c268e140b6 /libavformat/hls.c | |
parent | 0b511bd9a5487c672fe199ffb2a78a50fc5b2d9f (diff) | |
download | ffmpeg-b7f3a7c439885945af697580a0c08c0573f8885b.tar.gz |
lavf/hls: Add missed side data/disposition
hls 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.
Reviewed-by <liuqi05@kuaishou.com>
Signed-off-by: vacingfang <vacingfang@tencent.com>
Diffstat (limited to 'libavformat/hls.c')
-rw-r--r-- | libavformat/hls.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c index 17b3dd545d..3798bdd5d1 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -1768,6 +1768,20 @@ static int set_stream_info_from_input_stream(AVStream *st, struct playlist *pls, else 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); + } + st->internal->need_context_update = 1; return 0; |