Commit a4ff1de2 authored by Francois Cartegnie's avatar Francois Cartegnie

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

parent 5e3944b4
...@@ -485,9 +485,23 @@ static int AddStream(sout_mux_t *p_mux, sout_input_t *p_input) ...@@ -485,9 +485,23 @@ static int AddStream(sout_mux_t *p_mux, sout_input_t *p_input)
switch( p_stream->fmt.i_cat ) switch( p_stream->fmt.i_cat )
{ {
case AUDIO_ES: 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; p_stream->i_timescale = p_stream->fmt.audio.i_rate;
break; break;
case VIDEO_ES: 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->i_timescale = p_stream->fmt.video.i_frame_rate * 1000 /
p_stream->fmt.video.i_frame_rate_base; p_stream->fmt.video.i_frame_rate_base;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment