[vlc-commits] input: remove redundant test

Rémi Denis-Courmont git at videolan.org
Thu Jun 16 23:21:01 CEST 2016


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Jun 17 00:07:29 2016 +0300| [c1083a172f7c6348c25c7fa4a8f388f577ee0102] | committer: Rémi Denis-Courmont

input: remove redundant test

If demux_t.s is NULL, then the b_rescale_ts flag is true and the
DEMUX_SET_RATE control will fail. The end result is the same.

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

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

diff --git a/src/input/input.c b/src/input/input.c
index 61a92e0..cd639d7 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1858,20 +1858,11 @@ static bool Control( input_thread_t *p_input,
             if( i_rate != p_input->p->i_rate &&
                 !p_input->p->b_can_pace_control && p_input->p->b_can_rate_control )
             {
-                demux_t *p_demux = p_input->p->master->p_demux;
-                int i_ret = VLC_EGENERIC;
-                while (p_demux->p_next)
-                    p_demux = p_demux->p_next;
+                if( !p_input->p->master->b_rescale_ts )
+                    es_out_Control( p_input->p->p_es_out, ES_OUT_RESET_PCR );
 
-                if( p_demux->s == NULL )
-                {
-                    if( !p_input->p->master->b_rescale_ts )
-                        es_out_Control( p_input->p->p_es_out, ES_OUT_RESET_PCR );
-
-                    i_ret = demux_Control( p_input->p->master->p_demux,
-                                           DEMUX_SET_RATE, &i_rate );
-                }
-                if( i_ret )
+                if( demux_Control( p_input->p->master->p_demux, DEMUX_SET_RATE,
+                                   &i_rate ) )
                 {
                     msg_Warn( p_input, "ACCESS/DEMUX_SET_RATE failed" );
                     i_rate = p_input->p->i_rate;



More information about the vlc-commits mailing list