Commit 73876789 authored by Jai Menon's avatar Jai Menon Committed by Jean-Baptiste Kempf

AVFormat Muxer : Don't create AVStreams for unsupported ES types.

Currently, the libavformat based muxer supports audio and video streams
properly. Subtitle muxing is still a work-in-progress. Till those are
verified to work as well, we need to ensure that we don't create AVStreams
with invalid codec type.
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit e276b6488d2c59d61549828aafe95221f0e76146)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 435d14a3
...@@ -214,6 +214,12 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) ...@@ -214,6 +214,12 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
p_input->p_sys = malloc( sizeof( int ) ); p_input->p_sys = malloc( sizeof( int ) );
*((int *)p_input->p_sys) = p_sys->oc->nb_streams; *((int *)p_input->p_sys) = p_sys->oc->nb_streams;
if( p_input->p_fmt->i_cat != VIDEO_ES && p_input->p_fmt->i_cat != AUDIO_ES)
{
msg_Warn( p_mux, "Unhandled ES category" );
return VLC_EGENERIC;
}
stream = av_new_stream( p_sys->oc, p_sys->oc->nb_streams); stream = av_new_stream( p_sys->oc, p_sys->oc->nb_streams);
if( !stream ) if( !stream )
{ {
...@@ -258,8 +264,6 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input ) ...@@ -258,8 +264,6 @@ static int AddStream( sout_mux_t *p_mux, sout_input_t *p_input )
codec->time_base.num = p_input->p_fmt->video.i_frame_rate_base; codec->time_base.num = p_input->p_fmt->video.i_frame_rate_base;
break; break;
default:
msg_Warn( p_mux, "Unhandled ES category" );
} }
codec->bit_rate = p_input->p_fmt->i_bitrate; codec->bit_rate = p_input->p_fmt->i_bitrate;
......
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