diff mbox

[FFmpeg-devel,5/6] avformat/mov: use av_stereo3d_alloc2()

Message ID 20161211033308.8592-5-jamrial@gmail.com
State New
Headers show

Commit Message

James Almer Dec. 11, 2016, 3:33 a.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/isom.h | 1 +
 libavformat/mov.c  | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

Comments

Michael Niedermayer Dec. 12, 2016, 2:49 a.m. UTC | #1
On Sun, Dec 11, 2016 at 12:33:07AM -0300, James Almer wrote:
> Signed-off-by: James Almer <jamrial@gmail.com>
> ---
>  libavformat/isom.h | 1 +
>  libavformat/mov.c  | 6 +++---
>  2 files changed, 4 insertions(+), 3 deletions(-)

LGTM

thx

[...]
diff mbox

Patch

diff --git a/libavformat/isom.h b/libavformat/isom.h
index 0fd9eb0..70c2af1 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -181,6 +181,7 @@  typedef struct MOVStreamContext {
 
     int32_t *display_matrix;
     AVStereo3D *stereo3d;
+    size_t stereo3d_size;
     AVSphericalMapping *spherical;
     size_t spherical_size;
 
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 0b1c182..3f8fac7 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4535,7 +4535,7 @@  static int mov_read_st3d(MOVContext *c, AVIOContext *pb, MOVAtom atom)
         return 0;
     }
 
-    sc->stereo3d = av_stereo3d_alloc();
+    sc->stereo3d = av_stereo3d_alloc2(&sc->stereo3d_size);
     if (!sc->stereo3d)
         return AVERROR(ENOMEM);
 
@@ -4670,7 +4670,7 @@  static int mov_parse_uuid_spherical(MOVStreamContext *sc, AVIOContext *pb, size_
             else
                 mode = AV_STEREO3D_2D;
 
-            sc->stereo3d = av_stereo3d_alloc();
+            sc->stereo3d = av_stereo3d_alloc2(&sc->stereo3d_size);
             if (!sc->stereo3d)
                 goto out;
 
@@ -5933,7 +5933,7 @@  static int mov_read_header(AVFormatContext *s)
             if (sc->stereo3d) {
                 err = av_stream_add_side_data(st, AV_PKT_DATA_STEREO3D,
                                               (uint8_t *)sc->stereo3d,
-                                              sizeof(*sc->stereo3d));
+                                              sc->stereo3d_size);
                 if (err < 0)
                     return err;