[vlc-commits] mux: mp4: limit number of sync entries

Francois Cartegnie git at videolan.org
Fri Jul 4 18:56:28 CEST 2014


vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Jun 22 11:39:41 2014 +0200| [52aae4909b936e96af2be8f025e5b1eed959ce1a] | committer: Jean-Baptiste Kempf

mux: mp4: limit number of sync entries

(cherry picked from commit 1585e2ba3282e1e742c0f764b0ebc6ee418761aa)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=52aae4909b936e96af2be8f025e5b1eed959ce1a
---

 modules/mux/mp4.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/modules/mux/mp4.c b/modules/mux/mp4.c
index f066bc7..d1a7490 100644
--- a/modules/mux/mp4.c
+++ b/modules/mux/mp4.c
@@ -1499,8 +1499,16 @@ static bo_t *GetStblBox(sout_mux_t *p_mux, mp4_stream_t *p_stream)
     i_index = 0;
     if ( p_stream->fmt.i_cat == VIDEO_ES || p_stream->fmt.i_cat == AUDIO_ES )
     {
+        mtime_t i_interval = -1;
         for (unsigned i = 0; i < p_stream->i_entry_count; i++)
         {
+            if ( i_interval != -1 )
+            {
+                i_interval += p_stream->entry[i].i_length + p_stream->entry[i].i_pts_dts;
+                if ( i_interval < CLOCK_FREQ * 2 )
+                    continue;
+            }
+
             if (p_stream->entry[i].i_flags & BLOCK_FLAG_TYPE_I) {
                 if (stss == NULL) {
                     stss = box_full_new("stss", 0, 0);
@@ -1508,6 +1516,7 @@ static bo_t *GetStblBox(sout_mux_t *p_mux, mp4_stream_t *p_stream)
                 }
                 bo_add_32be(stss, 1 + i);
                 i_index++;
+                i_interval = 0;
             }
         }
     }



More information about the vlc-commits mailing list