Commit b90c40a9 authored by Christophe Mutricy's avatar Christophe Mutricy

Revert "Fix rate slower/faster in rewind mode."

This reverts commit 15f3efd9.

New features that are not self-contained and modify src/ are not
welcomed in -bugfix branches without pre-existent consensus.
parent ee59e046
...@@ -1370,6 +1370,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) ...@@ -1370,6 +1370,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
p_sys->i_npt_start = 0; p_sys->i_npt_start = 0;
p_sys->i_pcr = 0; p_sys->i_pcr = 0;
p_sys->i_npt = 0.0; p_sys->i_npt = 0.0;
es_out_Control( p_demux->out, ES_OUT_RESET_PCR );
*pi_int = (int)( INPUT_RATE_DEFAULT / p_sys->ms->scale() ); *pi_int = (int)( INPUT_RATE_DEFAULT / p_sys->ms->scale() );
msg_Dbg( p_demux, "PLAY with new Scale %0.2f (%d)", p_sys->ms->scale(), (*pi_int) ); msg_Dbg( p_demux, "PLAY with new Scale %0.2f (%d)", p_sys->ms->scale(), (*pi_int) );
......
...@@ -1599,13 +1599,10 @@ static bool Control( input_thread_t *p_input, int i_type, ...@@ -1599,13 +1599,10 @@ static bool Control( input_thread_t *p_input, int i_type,
case INPUT_CONTROL_SET_RATE_FASTER: case INPUT_CONTROL_SET_RATE_FASTER:
{ {
int i_rate; int i_rate;
int i_rate_sign;
/* Get rate and direction */
if( i_type == INPUT_CONTROL_SET_RATE ) if( i_type == INPUT_CONTROL_SET_RATE )
{ {
i_rate = abs( val.i_int ); i_rate = val.i_int;
i_rate_sign = val.i_int < 0 ? -1 : 1;
} }
else else
{ {
...@@ -1619,14 +1616,12 @@ static bool Control( input_thread_t *p_input, int i_type, ...@@ -1619,14 +1616,12 @@ static bool Control( input_thread_t *p_input, int i_type,
int i_idx; int i_idx;
int i; int i;
i_rate_sign = p_input->p->i_rate < 0 ? -1 : 1;
i_error = INT_MAX; i_error = INT_MAX;
i_idx = -1; i_idx = -1;
for( i = 0; ppi_factor[i][0] != 0; i++ ) for( i = 0; ppi_factor[i][0] != 0; i++ )
{ {
const int i_test_r = INPUT_RATE_DEFAULT * ppi_factor[i][0] / ppi_factor[i][1]; const int i_test_r = INPUT_RATE_DEFAULT * ppi_factor[i][0] / ppi_factor[i][1];
const int i_test_e = abs( abs( p_input->p->i_rate ) - i_test_r ); const int i_test_e = abs(p_input->p->i_rate - i_test_r);
if( i_test_e < i_error ) if( i_test_e < i_error )
{ {
i_idx = i; i_idx = i;
...@@ -1653,8 +1648,12 @@ static bool Control( input_thread_t *p_input, int i_type, ...@@ -1653,8 +1648,12 @@ static bool Control( input_thread_t *p_input, int i_type,
} }
} }
/* Check rate bound */ if( (i_rate < 0) && p_input->p->input.b_rescale_ts )
if( i_rate < INPUT_RATE_MIN ) {
msg_Dbg( p_input, "cannot set negative rate" );
i_rate = INPUT_RATE_MIN;
}
else if( (i_rate > 0) && (i_rate < INPUT_RATE_MIN) )
{ {
msg_Dbg( p_input, "cannot set rate faster" ); msg_Dbg( p_input, "cannot set rate faster" );
i_rate = INPUT_RATE_MIN; i_rate = INPUT_RATE_MIN;
...@@ -1664,22 +1663,6 @@ static bool Control( input_thread_t *p_input, int i_type, ...@@ -1664,22 +1663,6 @@ static bool Control( input_thread_t *p_input, int i_type,
msg_Dbg( p_input, "cannot set rate slower" ); msg_Dbg( p_input, "cannot set rate slower" );
i_rate = INPUT_RATE_MAX; i_rate = INPUT_RATE_MAX;
} }
/* Apply direction */
if( i_rate_sign < 0 )
{
if( p_input->p->input.b_rescale_ts )
{
msg_Dbg( p_input, "cannot set negative rate" );
i_rate = p_input->p->i_rate;
assert( i_rate > 0 );
}
else
{
i_rate *= i_rate_sign;
}
}
if( i_rate != INPUT_RATE_DEFAULT && if( i_rate != INPUT_RATE_DEFAULT &&
( ( !p_input->b_can_pace_control && !p_input->p->b_can_rate_control ) || ( ( !p_input->b_can_pace_control && !p_input->p->b_can_rate_control ) ||
( p_input->p->p_sout && !p_input->p->b_out_pace_control ) ) ) ( p_input->p->p_sout && !p_input->p->b_out_pace_control ) ) )
...@@ -1692,17 +1675,10 @@ static bool Control( input_thread_t *p_input, int i_type, ...@@ -1692,17 +1675,10 @@ static bool Control( input_thread_t *p_input, int i_type,
{ {
int i_ret; int i_ret;
if( p_input->p->input.p_access ) if( p_input->p->input.p_access )
{
i_ret = VLC_EGENERIC; i_ret = VLC_EGENERIC;
}
else else
{
if( !p_input->p->input.b_rescale_ts )
es_out_Control( p_input->p->p_es_out, ES_OUT_RESET_PCR );
i_ret = demux_Control( p_input->p->input.p_demux, i_ret = demux_Control( p_input->p->input.p_demux,
DEMUX_SET_RATE, &i_rate ); DEMUX_SET_RATE, &i_rate );
}
if( i_ret ) if( i_ret )
{ {
msg_Warn( p_input, "ACCESS/DEMUX_SET_RATE failed" ); msg_Warn( p_input, "ACCESS/DEMUX_SET_RATE failed" );
...@@ -1719,6 +1695,7 @@ static bool Control( input_thread_t *p_input, int i_type, ...@@ -1719,6 +1695,7 @@ static bool Control( input_thread_t *p_input, int i_type,
p_input->p->i_rate = i_rate; p_input->p->i_rate = i_rate;
/* FIXME do we need a RESET_PCR when !p_input->p->input.b_rescale_ts ? */
if( p_input->p->input.b_rescale_ts ) if( p_input->p->input.b_rescale_ts )
input_EsOutChangeRate( p_input->p->p_es_out, i_rate ); input_EsOutChangeRate( p_input->p->p_es_out, i_rate );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment