Commit 63b581b3 authored by Rafaël Carré's avatar Rafaël Carré Committed by Jean-Paul Saman

Closed Captions: spawn a decoder thread

We can't keep the cc decoder serialized with video decoder.
If the decoding delay between packetizer and video decoder is bigger
than caching (for example when using multi threaded decoder), we will
be too late for the next picture display while we wait for the right
rendering time for the CC.

Close #9049

(cherry picked from commit cac5ac7d0aba83dfabf3ce3e11ec7adc7cfb4e45)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 773793f8
......@@ -464,8 +464,8 @@ int input_DecoderSetCcState( decoder_t *p_dec, bool b_decode, int i_channel )
es_format_t fmt;
es_format_Init( &fmt, SPU_ES, fcc[i_channel] );
p_cc = CreateDecoder( VLC_OBJECT(p_dec), p_owner->p_input, &fmt,
false, p_owner->p_resource, p_owner->p_sout );
p_cc = input_DecoderNew( p_owner->p_input, &fmt,
p_dec->p_owner->p_clock, p_owner->p_sout );
if( !p_cc )
{
msg_Err( p_dec, "could not create decoder" );
......@@ -476,7 +476,7 @@ int input_DecoderSetCcState( decoder_t *p_dec, bool b_decode, int i_channel )
else if( !p_cc->p_module )
{
DecoderUnsupportedCodec( p_dec, fcc[i_channel] );
DeleteDecoder( p_cc );
input_DecoderDelete(p_cc);
return VLC_EGENERIC;
}
p_cc->p_owner->p_clock = p_owner->p_clock;
......@@ -495,10 +495,7 @@ int input_DecoderSetCcState( decoder_t *p_dec, bool b_decode, int i_channel )
vlc_mutex_unlock( &p_owner->lock );
if( p_cc )
{
module_unneed( p_cc, p_cc->p_module );
DeleteDecoder( p_cc );
}
input_DecoderDelete(p_cc);
}
return VLC_SUCCESS;
}
......@@ -1377,10 +1374,9 @@ static void DecoderGetCc( decoder_t *p_dec, decoder_t *p_dec_cc )
if( !p_owner->cc.pp_decoder[i] )
continue;
if( i_cc_decoder > 1 )
DecoderProcess( p_owner->cc.pp_decoder[i], block_Duplicate( p_cc ) );
else
DecoderProcess( p_owner->cc.pp_decoder[i], p_cc );
block_FifoPut( p_owner->cc.pp_decoder[i]->p_owner->p_fifo,
(i_cc_decoder > 1) ? block_Duplicate(p_cc) : p_cc);
i_cc_decoder--;
b_processed = true;
}
......
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