mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-11 06:58:18 +00:00
avformat/mov: use av_stream_add_side_data() for displaymatrix side data
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
2ab50647ff
commit
77f033eb98
@ -5647,20 +5647,13 @@ static int mov_read_header(AVFormatContext *s)
|
||||
break;
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
if (sc->display_matrix) {
|
||||
AVPacketSideData *sd, *tmp;
|
||||
int ret;
|
||||
|
||||
tmp = av_realloc_array(st->side_data,
|
||||
st->nb_side_data + 1, sizeof(*tmp));
|
||||
if (!tmp)
|
||||
return AVERROR(ENOMEM);
|
||||
ret = av_stream_add_side_data(st, AV_PKT_DATA_DISPLAYMATRIX, (uint8_t*)sc->display_matrix,
|
||||
sizeof(int32_t) * 9);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
st->side_data = tmp;
|
||||
st->nb_side_data++;
|
||||
|
||||
sd = &st->side_data[st->nb_side_data - 1];
|
||||
sd->type = AV_PKT_DATA_DISPLAYMATRIX;
|
||||
sd->size = sizeof(int32_t) * 9;
|
||||
sd->data = (uint8_t*)sc->display_matrix;
|
||||
sc->display_matrix = NULL;
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user