[vlc-devel] [PATCH] input: don't wait data to create sout input

Francois Cartegnie fcvlcdev at free.fr
Mon Jan 29 23:02:00 CET 2018


No sout mux buffer parameters is sufficient
as spu can arrive really late.
---
 src/input/decoder.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 0d3df97934..6a9a4fcb06 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1953,8 +1953,24 @@ decoder_t *input_DecoderNew( input_thread_t *p_input,
                              es_format_t *fmt, input_clock_t *p_clock,
                              sout_instance_t *p_sout  )
 {
-    return decoder_New( VLC_OBJECT(p_input), p_input, fmt, p_clock,
-                        input_priv(p_input)->p_resource, p_sout );
+    decoder_t *p_dec = decoder_New( VLC_OBJECT(p_input), p_input, fmt, p_clock,
+                                    input_priv(p_input)->p_resource, p_sout );
+#ifdef ENABLE_SOUT
+    /* Do not delay sout creation for SPU or DATA. */
+    if( p_dec && p_sout && fmt->b_packetized &&
+        (fmt->i_cat != VIDEO_ES && fmt->i_cat != AUDIO_ES) )
+    {
+        decoder_owner_sys_t *p_owner = p_dec->p_owner;
+        p_owner->p_sout_input = sout_InputNew( p_owner->p_sout, fmt );
+        if( p_owner->p_sout_input == NULL )
+        {
+            msg_Err( p_dec, "cannot create sout input (%4.4s)",
+                     (char *)&fmt->i_codec );
+            p_owner->error = true;
+        }
+    }
+#endif
+    return p_dec;
 }
 
 /**
-- 
2.14.3



More information about the vlc-devel mailing list