[FFmpeg-cvslog] avformat/mov: use av_stream_add_side_data() for displaymatrix side data

James Almer git at videolan.org
Sat Nov 19 03:22:10 EET 2016


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Thu Nov 17 02:19:19 2016 -0300| [77f033eb98d0d7d05f3aa238409d87fb1f6096b3] | committer: James Almer

avformat/mov: use av_stream_add_side_data() for displaymatrix side data

Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=77f033eb98d0d7d05f3aa238409d87fb1f6096b3
---

 libavformat/mov.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 8d6cc12..9bf436e 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -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);
-
-                st->side_data = tmp;
-                st->nb_side_data++;
+                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;
 
-                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;



More information about the ffmpeg-cvslog mailing list