[vlc-commits] mux: mp4: try to pick better scale for video track

Francois Cartegnie git at videolan.org
Tue Aug 9 20:21:26 CEST 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Aug  9 20:17:39 2016 +0200| [60bcc66da88332afc6e543b6d03e3c2dc4fb7559] | committer: Francois Cartegnie

mux: mp4: try to pick better scale for video track

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

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

diff --git a/modules/mux/mp4/mp4.c b/modules/mux/mp4/mp4.c
index 3473e6a..f59fd29 100644
--- a/modules/mux/mp4/mp4.c
+++ b/modules/mux/mp4/mp4.c
@@ -434,8 +434,14 @@ static int AddStream(sout_mux_t *p_mux, sout_input_t *p_input)
             p_stream->mux.fmt.video.i_frame_rate = 25;
             p_stream->mux.fmt.video.i_frame_rate_base = 1;
         }
-        p_stream->mux.i_timescale = p_stream->mux.fmt.video.i_frame_rate * 1000 /
-                                       p_stream->mux.fmt.video.i_frame_rate_base;
+
+        p_stream->mux.i_timescale = p_stream->mux.fmt.video.i_frame_rate *
+                                    p_stream->mux.fmt.video.i_frame_rate_base;
+
+        if( p_stream->mux.i_timescale > CLOCK_FREQ )
+            p_stream->mux.i_timescale = CLOCK_FREQ;
+        else if( p_stream->mux.i_timescale < 90000 )
+            p_stream->mux.i_timescale = 90000;
         break;
     default:
         break;



More information about the vlc-commits mailing list