[vlc-commits] mux: mp4: fix invalid track duration

Francois Cartegnie git at videolan.org
Mon May 4 22:29:23 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon May  4 22:28:00 2015 +0200| [ae42187332f22d27e449cff28de97218fca5dc0c] | committer: Francois Cartegnie

mux: mp4: fix invalid track duration

used to compute sample rate by demux

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

 modules/mux/mp4.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/mux/mp4.c b/modules/mux/mp4.c
index 217ef80..5204028 100644
--- a/modules/mux/mp4.c
+++ b/modules/mux/mp4.c
@@ -2199,7 +2199,7 @@ static bo_t *GetMoovBox(sout_mux_t *p_mux)
             bo_add_32be(mdhd, i_timestamp);   // creation time
             bo_add_32be(mdhd, i_timestamp);   // modification time
             bo_add_32be(mdhd, p_stream->i_timescale); // timescale
-            bo_add_32be(mdhd, i_stream_duration);  // duration
+            bo_add_32be(mdhd, i_stream_duration * p_stream->i_timescale / i_movie_timescale);  // duration
         } else {
             mdhd = box_full_new("mdhd", 1, 0);
             if(!mdhd)
@@ -2211,7 +2211,7 @@ static bo_t *GetMoovBox(sout_mux_t *p_mux)
             bo_add_64be(mdhd, i_timestamp);   // creation time
             bo_add_64be(mdhd, i_timestamp);   // modification time
             bo_add_32be(mdhd, p_stream->i_timescale); // timescale
-            bo_add_64be(mdhd, i_stream_duration);  // duration
+            bo_add_64be(mdhd, i_stream_duration * p_stream->i_timescale / i_movie_timescale);  // duration
         }
 
         if (p_stream->fmt.psz_language) {



More information about the vlc-commits mailing list