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

Francois Cartegnie git at videolan.org
Thu Jun 26 22:03:54 CEST 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Jun 22 11:39:41 2014 +0200| [1585e2ba3282e1e742c0f764b0ebc6ee418761aa] | committer: Francois Cartegnie

mux: mp4: limit number of sync entries

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1585e2ba3282e1e742c0f764b0ebc6ee418761aa
---

 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