[vlc-commits] Closed Captions: spawn a decoder thread
Rafaël Carré
git at videolan.org
Mon Sep 9 14:24:48 CEST 2013
vlc | branch: master | Rafaël Carré <funman at videolan.org> | Mon Sep 9 14:23:12 2013 +0200| [cac5ac7d0aba83dfabf3ce3e11ec7adc7cfb4e45] | committer: Rafaël Carré
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
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cac5ac7d0aba83dfabf3ce3e11ec7adc7cfb4e45
---
src/input/decoder.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/src/input/decoder.c b/src/input/decoder.c
index 9221426..b7e2ff9 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -466,8 +466,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" );
@@ -478,7 +478,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;
@@ -497,10 +497,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;
}
@@ -1341,10 +1338,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;
}
More information about the vlc-commits
mailing list