Commit a087b402 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove aout_filter_t.b_discontinuity

parent a4a13400
......@@ -171,7 +171,6 @@ struct aout_filter_t
aout_alloc_t output_alloc;
bool b_in_place;
bool b_continuity;
void (*pf_do_work)( aout_instance_t *, aout_filter_t *,
aout_buffer_t *, aout_buffer_t * );
......
......@@ -85,7 +85,6 @@ struct filter_sys_t
date_t end_date;
bool b_first;
bool b_filter2;
};
......@@ -228,16 +227,16 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
p_filter->fmt_in.audio.i_bytes_per_frame;
}
#endif
p_filter->b_continuity = false;
p_out_buf->i_flags |= BLOCK_FLAG_DISCONTINUITY;
p_sys->i_old_wing = 0;
return;
}
if( !p_filter->b_continuity )
if( p_in_buf->i_flags & BLOCK_FLAG_DISCONTINUITY )
{
/* Continuity in sound samples has been broken, we'd better reset
* everything. */
p_filter->b_continuity = true;
p_out_buf->i_flags |= BLOCK_FLAG_DISCONTINUITY;
p_sys->i_remainder = 0;
date_Init( &p_sys->end_date, i_out_rate, 1 );
date_Set( &p_sys->end_date, p_in_buf->i_pts );
......@@ -509,7 +508,6 @@ static int OpenFilter( vlc_object_t *p_this )
}
p_filter->p_sys->i_old_wing = 0;
p_sys->b_first = true;
p_sys->b_filter2 = true;
p_filter->pf_audio_filter = Resample;
......@@ -583,8 +581,6 @@ static block_t *Resample( filter_t *p_filter, block_t *p_block )
aout_filter.fmt_out.audio = p_filter->fmt_out.audio;
aout_filter.fmt_out.audio.i_bytes_per_frame = p_filter->fmt_out.audio.i_channels *
p_filter->fmt_out.audio.i_bitspersample / 8;
aout_filter.b_continuity = !p_filter->p_sys->b_first;
p_filter->p_sys->b_first = false;
in_buf.p_buffer = p_block->p_buffer;
in_buf.i_buffer = p_block->i_buffer;
......
......@@ -148,7 +148,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
if( p_aout->mixer_format.i_rate == p_filter->fmt_in.audio.i_rate )
{
#if 0 /* FIXME: needs audio filter2 for block_Realloc */
if( p_filter->b_continuity )
if( !(p_in_buf->i_flags & BLOCK_FLAG_DISCONTINUITY) )
{
p_in_buf = block_Realloc( p_in_buf, sizeof(float) * i_nb_channels,
p_in_buf->i_buffer );
......@@ -159,7 +159,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
i_nb_channels * sizeof(float) );
}
#endif
p_filter->b_continuity = false;
p_out_buf->i_flags |= BLOCK_FLAG_DISCONTINUITY;
return;
}
......@@ -168,9 +168,9 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
vlc_memcpy( p_in, p_in_buf->p_buffer, p_in_buf->i_buffer );
/* Take care of the previous input sample (if any) */
if( !p_filter->b_continuity )
if( p_in_buf->i_flags & BLOCK_FLAG_DISCONTINUITY )
{
p_filter->b_continuity = true;
p_out_buf->i_flags |= BLOCK_FLAG_DISCONTINUITY;
p_sys->i_remainder = 0;
date_Init( &p_sys->end_date, p_filter->fmt_out.audio.i_rate, 1 );
}
......@@ -335,7 +335,6 @@ static block_t *Resample( filter_t *p_filter, block_t *p_block )
aout_filter.p_sys = (struct aout_filter_sys_t *)p_filter->p_sys;
aout_filter.fmt_in.audio = p_filter->fmt_in.audio;
aout_filter.fmt_out.audio = p_filter->fmt_out.audio;
aout_filter.b_continuity = false;
in_buf.p_buffer = p_block->p_buffer;
in_buf.i_buffer = p_block->i_buffer;
......
......@@ -64,8 +64,6 @@ static aout_filter_t * FindFilter( aout_instance_t * p_aout,
return NULL;
}
p_filter->b_continuity = false;
return p_filter;
}
......
......@@ -370,7 +370,6 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input, const aout_
}
/* success */
p_filter->b_continuity = false;
p_input->pp_filters[p_input->i_nb_filters++] = p_filter;
memcpy( &chain_input_format, &p_filter->fmt_out.audio,
sizeof( audio_sample_format_t ) );
......@@ -593,6 +592,7 @@ int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
if ( p_input->i_resampling_type != AOUT_RESAMPLING_NONE )
msg_Warn( p_aout, "timing screwed, stopping resampling" );
inputResamplingStop( p_input );
p_buffer->i_flags |= BLOCK_FLAG_DISCONTINUITY;
start_date = 0;
}
......@@ -623,6 +623,7 @@ int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
if ( p_input->i_resampling_type != AOUT_RESAMPLING_NONE )
msg_Warn( p_aout, "timing screwed, stopping resampling" );
inputResamplingStop( p_input );
p_buffer->i_flags |= BLOCK_FLAG_DISCONTINUITY;
start_date = 0;
}
else if ( start_date != 0 &&
......@@ -720,6 +721,7 @@ int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
* is bad. We'd better stop the resampling right now. */
msg_Warn( p_aout, "timing screwed, stopping resampling" );
inputResamplingStop( p_input );
p_buffer->i_flags |= BLOCK_FLAG_DISCONTINUITY;
}
}
......@@ -794,7 +796,6 @@ static void inputResamplingStop( aout_input_t *p_input )
( p_input->pp_resamplers[0] == p_input->p_playback_rate_filter )
? INPUT_RATE_DEFAULT * p_input->input.i_rate / p_input->i_last_input_rate
: p_input->input.i_rate;
p_input->pp_resamplers[0]->b_continuity = false;
}
}
......
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