[vlc-commits] input: do not bypass demux when setting pause state

Rémi Denis-Courmont git at videolan.org
Tue Oct 20 22:33:13 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Oct 20 23:29:33 2015 +0300| [bab44e26a4e91354f8f47e2f1159d1c4fc97f101] | committer: Rémi Denis-Courmont

input: do not bypass demux when setting pause state

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

 src/input/input.c |   21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index 7bdbc19..be18600 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1532,19 +1532,13 @@ static void ControlRelease( int i_type, vlc_value_t val )
 /* Pause input */
 static void ControlPause( input_thread_t *p_input, mtime_t i_control_date )
 {
-    int i_ret = VLC_SUCCESS;
     int i_state = PAUSE_S;
 
     if( p_input->p->b_can_pause )
     {
         demux_t *p_demux = p_input->p->input.p_demux;
 
-        if( p_demux->s != NULL )
-            i_ret = stream_Control( p_demux->s, STREAM_SET_PAUSE_STATE, true );
-        else
-            i_ret = demux_Control( p_demux, DEMUX_SET_PAUSE_STATE, true );
-
-        if( i_ret )
+        if( demux_Control( p_demux, DEMUX_SET_PAUSE_STATE, true ) )
         {
             msg_Warn( p_input, "cannot set pause state" );
             return;
@@ -1552,10 +1546,8 @@ static void ControlPause( input_thread_t *p_input, mtime_t i_control_date )
     }
 
     /* */
-    i_ret = es_out_SetPauseState( p_input->p->p_es_out,
-                                  p_input->p->b_can_pause, true,
-                                  i_control_date );
-    if( i_ret )
+    if( es_out_SetPauseState( p_input->p->p_es_out, p_input->p->b_can_pause,
+                              true, i_control_date ) )
     {
         msg_Warn( p_input, "cannot set pause state at es_out level" );
         return;
@@ -1570,13 +1562,8 @@ static void ControlUnpause( input_thread_t *p_input, mtime_t i_control_date )
     if( p_input->p->b_can_pause )
     {
         demux_t *p_demux = p_input->p->input.p_demux;
-        int ret;
 
-        if( p_demux->s != NULL )
-            ret = stream_Control( p_demux->s, STREAM_SET_PAUSE_STATE, false );
-        else
-            ret = demux_Control( p_demux, DEMUX_SET_PAUSE_STATE, false );
-        if( ret != VLC_SUCCESS )
+        if( demux_Control( p_demux, DEMUX_SET_PAUSE_STATE, false ) )
         {
             msg_Err( p_input, "cannot resume" );
             input_ChangeState( p_input, ERROR_S );



More information about the vlc-commits mailing list