[vlc-commits] decoder: split DecoderGetCc

Thomas Guillem git at videolan.org
Thu Feb 9 15:57:28 CET 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Feb  9 15:10:28 2017 +0100| [548d2cf6b88253ca0726e656f15a4c46690deaba] | committer: Thomas Guillem

decoder: split DecoderGetCc

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=548d2cf6b88253ca0726e656f15a4c46690deaba
---

 src/input/decoder.c | 33 ++++++++++++++++++++-------------
 1 file changed, 20 insertions(+), 13 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index bc7eb3c..70a5823 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -857,24 +857,13 @@ static void DecoderProcessSout( decoder_t *p_dec, block_t *p_block )
 }
 #endif
 
-static void DecoderGetCc( decoder_t *p_dec, decoder_t *p_dec_cc )
+static void DecoderExtractCc( decoder_t *p_dec, block_t *p_cc,
+                              bool pb_present[4] )
 {
     decoder_owner_sys_t *p_owner = p_dec->p_owner;
-    block_t *p_cc;
-    bool pb_present[4];
     bool b_processed = false;
     int i_cc_decoder = 0;
 
-    assert( p_dec_cc->pf_get_cc != NULL );
-
-    /* Do not try retreiving CC if not wanted (sout) or cannot be retreived */
-    if( !p_owner->cc.b_supported )
-        return;
-
-    p_cc = p_dec_cc->pf_get_cc( p_dec_cc, pb_present );
-    if( !p_cc )
-        return;
-
     vlc_mutex_lock( &p_owner->lock );
     for( int i = 0; i < 4; i++ )
     {
@@ -900,6 +889,24 @@ static void DecoderGetCc( decoder_t *p_dec, decoder_t *p_dec_cc )
         block_Release( p_cc );
 }
 
+static void DecoderGetCc( decoder_t *p_dec, decoder_t *p_dec_cc )
+{
+    decoder_owner_sys_t *p_owner = p_dec->p_owner;
+    block_t *p_cc;
+    bool pb_present[4];
+
+    assert( p_dec_cc->pf_get_cc != NULL );
+
+    /* Do not try retreiving CC if not wanted (sout) or cannot be retreived */
+    if( !p_owner->cc.b_supported )
+        return;
+
+    p_cc = p_dec_cc->pf_get_cc( p_dec_cc, pb_present );
+    if( !p_cc )
+        return;
+    DecoderExtractCc( p_dec, p_cc, pb_present );
+}
+
 static int DecoderPlayVideo( decoder_t *p_dec, picture_t *p_picture,
                              unsigned *restrict pi_lost_sum )
 {



More information about the vlc-commits mailing list