Commit 9adad8ff authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

vlc_codec: make sure we don't update the audio/video format on the wrong kind of track

We would write in the wrong parts of the es_format_t union.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent acc69aed
......@@ -249,7 +249,8 @@ struct encoder_t
*/
static inline int decoder_UpdateVideoFormat( decoder_t *dec )
{
if( dec->pf_vout_format_update != NULL )
assert( dec->fmt_in.i_cat == VIDEO_ES );
if( dec->fmt_in.i_cat == VIDEO_ES && dec->pf_vout_format_update != NULL )
return dec->pf_vout_format_update( dec );
else
return -1;
......@@ -365,7 +366,8 @@ static inline int decoder_QueueSub( decoder_t *dec, subpicture_t *p_spu )
* @return 0 if the audio output is working, -1 if not. */
static inline int decoder_UpdateAudioFormat( decoder_t *dec )
{
if( dec->pf_aout_format_update != NULL )
assert(dec->fmt_in.i_cat == AUDIO_ES);
if( dec->fmt_in.i_cat == AUDIO_ES && dec->pf_aout_format_update != NULL )
return dec->pf_aout_format_update( dec );
else
return -1;
......
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