Commit 1893495e authored by James Almer's avatar James Almer Committed by Vittorio Giovara

mov: Use av_stream_add_side_data() for displaymatrix side data

Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
Signed-off-by: 's avatarVittorio Giovara <vittorio.giovara@gmail.com>
parent 79ff9935
...@@ -3545,20 +3545,12 @@ static int mov_read_header(AVFormatContext *s) ...@@ -3545,20 +3545,12 @@ static int mov_read_header(AVFormatContext *s)
break; break;
case AVMEDIA_TYPE_VIDEO: case AVMEDIA_TYPE_VIDEO:
if (sc->display_matrix) { if (sc->display_matrix) {
AVPacketSideData *sd, *tmp; err = av_stream_add_side_data(st, AV_PKT_DATA_DISPLAYMATRIX,
(uint8_t *)sc->display_matrix,
tmp = av_realloc_array(st->side_data, sizeof(int32_t) * 9);
st->nb_side_data + 1, sizeof(*tmp)); if (err < 0)
if (!tmp) return err;
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; sc->display_matrix = NULL;
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment