[FFmpeg-cvslog] avformat/mov: add support for sync group in sbgp box

Clément Bœsch git at videolan.org
Fri Mar 4 17:33:39 EET 2022


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Fri Feb 18 22:52:31 2022 +0100| [eb947471b245d0c2563c057fca5d1a18e57b3643] | committer: Clément Bœsch

avformat/mov: add support for sync group in sbgp box

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

 libavformat/isom.h | 2 ++
 libavformat/mov.c  | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/libavformat/isom.h b/libavformat/isom.h
index 625dea8421..e326f4f27f 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -218,6 +218,8 @@ typedef struct MOVStreamContext {
     int start_pad;        ///< amount of samples to skip due to enc-dec delay
     unsigned int rap_group_count;
     MOVSbgp *rap_group;
+    unsigned int sync_group_count;
+    MOVSbgp *sync_group;
 
     int nb_frames_for_fps;
     int64_t duration_for_fps;
diff --git a/libavformat/mov.c b/libavformat/mov.c
index cd587cc510..6221bb0490 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3152,6 +3152,9 @@ static int mov_read_sbgp(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     if (grouping_type == MKTAG('r','a','p',' ')) {
         tablep = &sc->rap_group;
         table_count = &sc->rap_group_count;
+    } else if (grouping_type == MKTAG('s','y','n','c')) {
+        tablep = &sc->sync_group;
+        table_count = &sc->sync_group_count;
     } else {
         return 0;
     }
@@ -4371,6 +4374,7 @@ static int mov_read_trak(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     av_freep(&sc->stps_data);
     av_freep(&sc->elst_data);
     av_freep(&sc->rap_group);
+    av_freep(&sc->sync_group);
 
     return 0;
 }
@@ -7710,6 +7714,7 @@ static int mov_read_close(AVFormatContext *s)
         av_freep(&sc->stps_data);
         av_freep(&sc->elst_data);
         av_freep(&sc->rap_group);
+        av_freep(&sc->sync_group);
         av_freep(&sc->display_matrix);
         av_freep(&sc->index_ranges);
 



More information about the ffmpeg-cvslog mailing list