[vlc-commits] mux: mp4: default missing audio/frame rate (fix #12820)

Francois Cartegnie git at videolan.org
Thu Dec 25 15:17:04 CET 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Dec 25 15:14:52 2014 +0100| [a4ff1de2a702e35a1364321276520c8acbbff46a] | committer: Francois Cartegnie

mux: mp4: default missing audio/frame rate (fix #12820)

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

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

diff --git a/modules/mux/mp4.c b/modules/mux/mp4.c
index ee5d785..bc2ae40 100644
--- a/modules/mux/mp4.c
+++ b/modules/mux/mp4.c
@@ -485,9 +485,23 @@ static int AddStream(sout_mux_t *p_mux, sout_input_t *p_input)
     switch( p_stream->fmt.i_cat )
     {
     case AUDIO_ES:
+        if(!p_stream->fmt.audio.i_rate)
+        {
+            msg_Warn( p_mux, "no audio rate given for stream %d, assuming 48KHz",
+                      p_sys->i_nb_streams );
+            p_stream->fmt.audio.i_rate = 48000;
+        }
         p_stream->i_timescale = p_stream->fmt.audio.i_rate;
         break;
     case VIDEO_ES:
+        if( !p_stream->fmt.video.i_frame_rate ||
+            !p_stream->fmt.video.i_frame_rate_base )
+        {
+            msg_Warn( p_mux, "Missing frame rate for stream %d, assuming 25fps",
+                      p_sys->i_nb_streams );
+            p_stream->fmt.video.i_frame_rate = 25;
+            p_stream->fmt.video.i_frame_rate_base = 1;
+        }
         p_stream->i_timescale = p_stream->fmt.video.i_frame_rate * 1000 /
                                 p_stream->fmt.video.i_frame_rate_base;
         break;



More information about the vlc-commits mailing list