[vlc-devel] [RFC-PATCH 11/12] core: simplified DecoderQueueSpu

Filip Roséen filip at videolabs.io
Wed May 11 18:56:56 CEST 2016


DecoderQueueSpu previously contained more logic than what is actually
the responsiblity of the function. Given the implementation of
DecoderQueueVideo and DecoderQueueAudio, this function should follow the
same behavior.

When the function is (indirectly) invoked from decoder_QueueSub, the
expected behavior is to actually queue what is being sent (ie. we should
not do any "filtering" in DecoderQueueSpu).
---
 src/input/decoder.c | 40 +++-------------------------------------
 1 file changed, 3 insertions(+), 37 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index d94a027..30ccad8 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1281,44 +1281,10 @@ static void DecoderUpdateStatSpu( decoder_t *p_dec, unsigned decoded )
 
 static int DecoderQueueSpu( decoder_t *p_dec, subpicture_t *p_spu )
 {
-    assert( p_spu );
-    decoder_owner_sys_t *p_owner = p_dec->p_owner;
-    input_thread_t *p_input = p_owner->p_input;
-
-    if( p_input != NULL )
-    {
-        vlc_mutex_lock( &p_input->p->counters.counters_lock );
-        stats_Update( p_input->p->counters.p_decoded_sub, 1, NULL );
-        vlc_mutex_unlock( &p_input->p->counters.counters_lock );
-    }
+    DecoderPlaySpu( p_dec, p_spu );
+    DecoderUpdateStatSpu( p_dec, 1 );
 
-    int i_ret = -1;
-    vout_thread_t *p_vout = input_resource_HoldVout( p_owner->p_resource );
-    if( p_vout && p_owner->p_spu_vout == p_vout )
-    {
-        /* Preroll does not work very well with subtitle */
-        vlc_mutex_lock( &p_owner->lock );
-        if( p_spu->i_start > VLC_TS_INVALID &&
-            p_spu->i_start < p_owner->i_preroll_end &&
-            ( p_spu->i_stop <= VLC_TS_INVALID || p_spu->i_stop < p_owner->i_preroll_end ) )
-        {
-            vlc_mutex_unlock( &p_owner->lock );
-            subpicture_Delete( p_spu );
-        }
-        else
-        {
-            vlc_mutex_unlock( &p_owner->lock );
-            DecoderPlaySpu( p_dec, p_spu );
-            i_ret = 0;
-        }
-    }
-    else
-    {
-        subpicture_Delete( p_spu );
-    }
-    if( p_vout )
-        vlc_object_release( p_vout );
-    return i_ret;
+    return VLC_SUCCESS;
 }
 
 /* This function process a subtitle block
-- 
2.8.2



More information about the vlc-devel mailing list