mov: Use av_stream_add_side_data() for displaymatrix side data

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
This commit is contained in:
James Almer 2016-11-21 18:54:29 -05:00 committed by Vittorio Giovara
parent 79ff9935ae
commit 1893495e1d

View File

@ -3545,20 +3545,12 @@ static int mov_read_header(AVFormatContext *s)
break;
case AVMEDIA_TYPE_VIDEO:
if (sc->display_matrix) {
AVPacketSideData *sd, *tmp;
err = av_stream_add_side_data(st, AV_PKT_DATA_DISPLAYMATRIX,
(uint8_t *)sc->display_matrix,
sizeof(int32_t) * 9);
if (err < 0)
return err;
tmp = av_realloc_array(st->side_data,
st->nb_side_data + 1, sizeof(*tmp));
if (!tmp)
return AVERROR(ENOMEM);
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;