[vlc-commits] es_out: drain captions sub ES along with main ES
Francois Cartegnie
git at videolan.org
Wed Nov 7 14:24:22 CET 2018
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Nov 7 14:17:03 2018 +0100| [04c87385c74912ad0c8e001381edd0b223fc047f] | committer: Francois Cartegnie
es_out: drain captions sub ES along with main ES
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=04c87385c74912ad0c8e001381edd0b223fc047f
---
src/input/es_out.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/input/es_out.c b/src/input/es_out.c
index cf765f96e7..21ba6137eb 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -1899,6 +1899,19 @@ static void EsOutSelectEs( es_out_t *out, es_out_id_t *es )
}
}
+static void EsOutDrainCCChannels( es_out_id_t *parent )
+{
+ /* Drain captions sub ES as well */
+ uint64_t i_bitmap = parent->cc.i_bitmap;
+ for( int i = 0; i_bitmap > 0; i++, i_bitmap >>= 1 )
+ {
+ if( (i_bitmap & 1) == 0 || !parent->cc.pp_es[i] ||
+ !parent->cc.pp_es[i]->p_dec )
+ continue;
+ input_DecoderDrain( parent->cc.pp_es[i]->p_dec );
+ }
+}
+
static void EsDeleteCCChannels( es_out_t *out, es_out_id_t *parent )
{
if( parent->cc.type == 0 )
@@ -2263,6 +2276,7 @@ EsOutDrainDecoder( es_out_t *out, es_out_id_t *es )
* the corresponding thread (typically the input thread), for a little
* bit too long if the ES is deleted in the middle of a stream. */
input_DecoderDrain( es->p_dec );
+ EsOutDrainCCChannels( es );
while( !input_Stopped(p_sys->p_input) && !p_sys->b_buffering )
{
if( input_DecoderIsEmpty( es->p_dec ) &&
More information about the vlc-commits
mailing list