]> git.sesse.net Git - vlc/commitdiff
* input/input_dec.c: we automaticaly switch to minimize thread mode
authorLaurent Aimar <fenrir@videolan.org>
Wed, 7 Apr 2004 23:13:03 +0000 (23:13 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Wed, 7 Apr 2004 23:13:03 +0000 (23:13 +0000)
when streaming (it's better because of the way sout works).
 * stream_output/stream_output.c: when removing a stream, stop waiting
and start muxing if data are already here (needed for sout with pace
control).

 Both will help to allow muxing (nearly?) all frames, even the last ones.

src/input/input_dec.c
src/stream_output/stream_output.c

index 9c33ecfdc98cf0b0e4de1862903a85a1a84d25f6..65eae02e8b8c4e7b00f45af85ade1cd241308e2b 100644 (file)
@@ -133,8 +133,16 @@ decoder_t * input_RunDecoder( input_thread_t * p_input, es_descriptor_t * p_es )
         return NULL;
     }
 
-    var_Get( p_input, "minimize-threads", &val );
-    p_dec->p_owner->b_own_thread = val.b_bool ? VLC_FALSE : VLC_TRUE;
+    if( !p_es->b_force_decoder && p_input->stream.p_sout )
+    {
+        msg_Dbg( p_input, "stream out mode -> no decoder thread" );
+        p_dec->p_owner->b_own_thread = VLC_FALSE;
+    }
+    else
+    {
+        var_Get( p_input, "minimize-threads", &val );
+        p_dec->p_owner->b_own_thread = !val.b_bool;
+    }
 
     if( p_dec->p_owner->b_own_thread )
     {
index 58a163c09083bcb96cbc263462b22fca6ae51e3f..241dd90fc52c9d2a62ca2914e42aec5c1a3a1de1 100644 (file)
@@ -499,6 +499,14 @@ void sout_MuxDeleteStream( sout_mux_t *p_mux, sout_input_t *p_input )
 {
     int i_index;
 
+    if( p_mux->b_waiting_stream && p_input->p_fifo->i_depth > 0 )
+    {
+        /* We stop waiting, and call the muxer for taking care of the data
+         * before we remove this es */
+        p_mux->b_waiting_stream = VLC_FALSE;
+        p_mux->pf_mux( p_mux );
+    }
+
     TAB_FIND( p_mux->i_nb_inputs, p_mux->pp_inputs, p_input, i_index );
     if( i_index >= 0 )
     {