Commit 3dc6aa51 authored by Laurent Aimar's avatar Laurent Aimar

Use the decoder output format instead of the input format.

It fixes a logical bug as the input and output format could be different.
(Not plugin that does that yet).
parent 7a0c49ac
...@@ -303,8 +303,9 @@ decoder_t *input_DecoderNew( input_thread_t *p_input, ...@@ -303,8 +303,9 @@ decoder_t *input_DecoderNew( input_thread_t *p_input,
} }
p_dec->p_owner->p_clock = p_clock; p_dec->p_owner->p_clock = p_clock;
assert( p_dec->fmt_out.i_cat != UNKNOWN_ES );
if( fmt->i_cat == AUDIO_ES ) if( p_dec->fmt_out.i_cat == AUDIO_ES )
i_priority = VLC_THREAD_PRIORITY_AUDIO; i_priority = VLC_THREAD_PRIORITY_AUDIO;
else else
i_priority = VLC_THREAD_PRIORITY_VIDEO; i_priority = VLC_THREAD_PRIORITY_VIDEO;
...@@ -586,7 +587,7 @@ void input_DecoderFrameNext( decoder_t *p_dec, mtime_t *pi_duration ) ...@@ -586,7 +587,7 @@ void input_DecoderFrameNext( decoder_t *p_dec, mtime_t *pi_duration )
*pi_duration = 0; *pi_duration = 0;
vlc_mutex_lock( &p_owner->lock ); vlc_mutex_lock( &p_owner->lock );
if( p_dec->fmt_in.i_cat == VIDEO_ES ) if( p_dec->fmt_out.i_cat == VIDEO_ES )
{ {
if( p_owner->b_paused && p_owner->p_vout ) if( p_owner->b_paused && p_owner->p_vout )
{ {
...@@ -1011,13 +1012,13 @@ static void DecoderOutputChangePause( decoder_t *p_dec, bool b_paused, mtime_t i ...@@ -1011,13 +1012,13 @@ static void DecoderOutputChangePause( decoder_t *p_dec, bool b_paused, mtime_t i
* - for sout it is useless * - for sout it is useless
* - for subs, it is done by the vout * - for subs, it is done by the vout
*/ */
if( p_dec->fmt_in.i_cat == AUDIO_ES ) if( p_dec->fmt_out.i_cat == AUDIO_ES )
{ {
if( p_owner->p_aout && p_owner->p_aout_input ) if( p_owner->p_aout && p_owner->p_aout_input )
aout_DecChangePause( p_owner->p_aout, p_owner->p_aout_input, aout_DecChangePause( p_owner->p_aout, p_owner->p_aout_input,
b_paused, i_date ); b_paused, i_date );
} }
else if( p_dec->fmt_in.i_cat == VIDEO_ES ) else if( p_dec->fmt_out.i_cat == VIDEO_ES )
{ {
if( p_owner->p_vout ) if( p_owner->p_vout )
vout_ChangePause( p_owner->p_vout, b_paused, i_date ); vout_ChangePause( p_owner->p_vout, b_paused, i_date );
...@@ -1975,15 +1976,15 @@ static void DecoderProcess( decoder_t *p_dec, block_t *p_block ) ...@@ -1975,15 +1976,15 @@ static void DecoderProcess( decoder_t *p_dec, block_t *p_block )
p_block->i_flags &= ~BLOCK_FLAG_CORE_PRIVATE_MASK; p_block->i_flags &= ~BLOCK_FLAG_CORE_PRIVATE_MASK;
} }
if( p_dec->fmt_in.i_cat == AUDIO_ES ) if( p_dec->fmt_out.i_cat == AUDIO_ES )
{ {
DecoderProcessAudio( p_dec, p_block, b_flush ); DecoderProcessAudio( p_dec, p_block, b_flush );
} }
else if( p_dec->fmt_in.i_cat == VIDEO_ES ) else if( p_dec->fmt_out.i_cat == VIDEO_ES )
{ {
DecoderProcessVideo( p_dec, p_block, b_flush ); DecoderProcessVideo( p_dec, p_block, b_flush );
} }
else if( p_dec->fmt_in.i_cat == SPU_ES ) else if( p_dec->fmt_out.i_cat == SPU_ES )
{ {
DecoderProcessSpu( p_dec, p_block, b_flush ); DecoderProcessSpu( p_dec, p_block, b_flush );
} }
...@@ -2066,7 +2067,7 @@ static void DeleteDecoder( decoder_t * p_dec ) ...@@ -2066,7 +2067,7 @@ static void DeleteDecoder( decoder_t * p_dec )
} }
#endif #endif
if( p_dec->fmt_in.i_cat == SPU_ES ) if( p_dec->fmt_out.i_cat == SPU_ES )
{ {
vout_thread_t *p_vout; vout_thread_t *p_vout;
......
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