[vlc-commits] Closed Captions: spawn a decoder thread
Rafaël Carré
git at videolan.org
Thu Sep 19 12:46:17 CEST 2013
vlc/vlc-2.1 | branch: master | Rafaël Carré <funman at videolan.org> | Mon Sep 9 14:23:12 2013 +0200| [7ff523329979c1e25b3de899cb6f94a010a7b68a] | committer: Jean-Baptiste Kempf
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: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=7ff523329979c1e25b3de899cb6f94a010a7b68a
---
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 b1b038c..c86e06f 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -459,8 +459,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" );
@@ -471,7 +471,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;
@@ -490,10 +490,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;
}
@@ -1336,10 +1333,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