mirror of
https://code.videolan.org/videolan/vlc
synced 2024-08-31 06:46:39 +02:00
i_nb_bytes -> i_buffer
(Yeah, some automatic variables were renamed too)
This commit is contained in:
parent
38c0878998
commit
6c9479be6c
@ -131,7 +131,7 @@ struct aout_buffer_t
|
||||
uint8_t * p_buffer;
|
||||
/* i_size is the real size of the buffer (used for debug ONLY), i_nb_bytes
|
||||
* is the number of significative bytes in it. */
|
||||
size_t i_size, i_nb_bytes;
|
||||
size_t i_size, i_buffer;
|
||||
unsigned int i_nb_samples;
|
||||
uint32_t i_flags;
|
||||
mtime_t i_pts, i_length;
|
||||
|
@ -176,9 +176,9 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
size_t i;
|
||||
|
||||
p_out_buf->i_nb_samples = i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = sizeof(float) * i_nb_samples
|
||||
p_out_buf->i_buffer = sizeof(float) * i_nb_samples
|
||||
* aout_FormatNbChannels( &p_filter->output );
|
||||
memset( p_out, 0, p_out_buf->i_nb_bytes );
|
||||
memset( p_out, 0, p_out_buf->i_buffer );
|
||||
|
||||
|
||||
if( p_sys->i_rear_left >= 0 )
|
||||
|
@ -466,9 +466,9 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
|
||||
/* out buffer characterisitcs */
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes * i_output_nb / i_input_nb;
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer * i_output_nb / i_input_nb;
|
||||
p_out = p_out_buf->p_buffer;
|
||||
i_out_size = p_out_buf->i_nb_bytes;
|
||||
i_out_size = p_out_buf->i_buffer;
|
||||
|
||||
/* Slide the overflow buffer */
|
||||
p_overflow = p_sys->p_overflow_buffer;
|
||||
@ -675,15 +675,15 @@ static block_t *Convert( filter_t *p_filter, block_t *p_block )
|
||||
aout_filter.b_in_place = 0;
|
||||
|
||||
in_buf.p_buffer = p_block->p_buffer;
|
||||
in_buf.i_nb_bytes = p_block->i_buffer;
|
||||
in_buf.i_buffer = p_block->i_buffer;
|
||||
in_buf.i_nb_samples = p_block->i_nb_samples;
|
||||
out_buf.p_buffer = p_out->p_buffer;
|
||||
out_buf.i_nb_bytes = p_out->i_buffer;
|
||||
out_buf.i_buffer = p_out->i_buffer;
|
||||
out_buf.i_nb_samples = p_out->i_nb_samples;
|
||||
|
||||
DoWork( (aout_instance_t *)p_filter, &aout_filter, &in_buf, &out_buf );
|
||||
|
||||
p_out->i_buffer = out_buf.i_nb_bytes;
|
||||
p_out->i_buffer = out_buf.i_buffer;
|
||||
p_out->i_nb_samples = out_buf.i_nb_samples;
|
||||
|
||||
block_Release( p_block );
|
||||
|
@ -490,13 +490,13 @@ static block_t *Convert( filter_t *p_filter, block_t *p_block )
|
||||
aout_filter.output.i_format = p_filter->fmt_out.i_codec;
|
||||
|
||||
in_buf.p_buffer = p_block->p_buffer;
|
||||
in_buf.i_nb_bytes = p_block->i_buffer;
|
||||
in_buf.i_buffer = p_block->i_buffer;
|
||||
in_buf.i_nb_samples = p_block->i_nb_samples;
|
||||
|
||||
#if 0
|
||||
unsigned int i_in_size = in_buf.i_nb_samples * (p_filter->p_sys->i_bitspersample/8) *
|
||||
aout_FormatNbChannels( &(p_filter->fmt_in.audio) );
|
||||
if( (in_buf.i_nb_bytes != i_in_size) && ((i_in_size % 32) != 0) ) /* is it word aligned?? */
|
||||
if( (in_buf.i_buffer != i_in_size) && ((i_in_size % 32) != 0) ) /* is it word aligned?? */
|
||||
{
|
||||
msg_Err( p_filter, "input buffer is not word aligned" );
|
||||
/* Fix output buffer to be word aligned */
|
||||
@ -504,7 +504,7 @@ static block_t *Convert( filter_t *p_filter, block_t *p_block )
|
||||
#endif
|
||||
|
||||
out_buf.p_buffer = p_out->p_buffer;
|
||||
out_buf.i_nb_bytes = p_out->i_buffer;
|
||||
out_buf.i_buffer = p_out->i_buffer;
|
||||
out_buf.i_nb_samples = p_out->i_nb_samples;
|
||||
|
||||
memset( p_out->p_buffer, 0, i_out_size );
|
||||
@ -518,7 +518,7 @@ static block_t *Convert( filter_t *p_filter, block_t *p_block )
|
||||
i_samples = stereo_to_mono( &aout_filter, &out_buf, &in_buf );
|
||||
}
|
||||
|
||||
p_out->i_buffer = out_buf.i_nb_bytes;
|
||||
p_out->i_buffer = out_buf.i_buffer;
|
||||
p_out->i_nb_samples = out_buf.i_nb_samples;
|
||||
|
||||
block_Release( p_block );
|
||||
@ -555,9 +555,9 @@ static void stereo2mono_downmix( aout_filter_t * p_filter,
|
||||
|
||||
/* out buffer characterisitcs */
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes * i_output_nb / i_input_nb;
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer * i_output_nb / i_input_nb;
|
||||
p_out = p_out_buf->p_buffer;
|
||||
i_out_size = p_out_buf->i_nb_bytes;
|
||||
i_out_size = p_out_buf->i_buffer;
|
||||
|
||||
/* Slide the overflow buffer */
|
||||
p_overflow = p_sys->p_overflow_buffer;
|
||||
|
@ -119,7 +119,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
int i;
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes * i_output_nb / i_input_nb;
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer * i_output_nb / i_input_nb;
|
||||
|
||||
if( p_filter->output.i_physical_channels == AOUT_CHANS_2_0 )
|
||||
{
|
||||
@ -312,17 +312,17 @@ static block_t *Filter( filter_t *p_filter, block_t *p_block )
|
||||
aout_filter.output.i_format = p_filter->fmt_out.i_codec;
|
||||
|
||||
in_buf.p_buffer = p_block->p_buffer;
|
||||
in_buf.i_nb_bytes = p_block->i_buffer;
|
||||
in_buf.i_buffer = p_block->i_buffer;
|
||||
in_buf.i_nb_samples = p_block->i_nb_samples;
|
||||
out_buf.p_buffer = p_out->p_buffer;
|
||||
out_buf.i_nb_bytes = p_out->i_buffer;
|
||||
out_buf.i_buffer = p_out->i_buffer;
|
||||
out_buf.i_nb_samples = p_out->i_nb_samples;
|
||||
|
||||
DoWork( (aout_instance_t *)p_filter, &aout_filter, &in_buf, &out_buf );
|
||||
|
||||
block_Release( p_block );
|
||||
|
||||
p_out->i_buffer = out_buf.i_nb_bytes;
|
||||
p_out->i_buffer = out_buf.i_buffer;
|
||||
p_out->i_nb_samples = out_buf.i_nb_samples;
|
||||
|
||||
return p_out;
|
||||
|
@ -119,7 +119,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
int32_t * p_src = (int32_t *)p_in_buf->p_buffer;
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes * i_output_nb / i_input_nb;
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer * i_output_nb / i_input_nb;
|
||||
|
||||
if ( (p_filter->output.i_original_channels & AOUT_CHAN_PHYSMASK)
|
||||
!= (p_filter->input.i_original_channels & AOUT_CHAN_PHYSMASK)
|
||||
|
@ -246,7 +246,7 @@ static void DoWork( aout_instance_t *p_aout, aout_filter_t *p_filter,
|
||||
float *pf_ptr, f_diff = 0, f_frac = 0, f_temp = 0 ;
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes;
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer;
|
||||
|
||||
/* Process each sample */
|
||||
for( int i = 0; i < i_samples ; i++ )
|
||||
|
@ -392,7 +392,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
}
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = i_bytes_per_block * 6;
|
||||
p_out_buf->i_buffer = i_bytes_per_block * 6;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@ -494,15 +494,15 @@ static block_t *Convert( filter_t *p_filter, block_t *p_block )
|
||||
aout_filter.output.i_format = p_filter->fmt_out.i_codec;
|
||||
|
||||
in_buf.p_buffer = p_block->p_buffer;
|
||||
in_buf.i_nb_bytes = p_block->i_buffer;
|
||||
in_buf.i_buffer = p_block->i_buffer;
|
||||
in_buf.i_nb_samples = p_block->i_nb_samples;
|
||||
out_buf.p_buffer = p_out->p_buffer;
|
||||
out_buf.i_nb_bytes = p_out->i_buffer;
|
||||
out_buf.i_buffer = p_out->i_buffer;
|
||||
out_buf.i_nb_samples = p_out->i_nb_samples;
|
||||
|
||||
DoWork( (aout_instance_t *)p_filter, &aout_filter, &in_buf, &out_buf );
|
||||
|
||||
p_out->i_buffer = out_buf.i_nb_bytes;
|
||||
p_out->i_buffer = out_buf.i_buffer;
|
||||
p_out->i_nb_samples = out_buf.i_nb_samples;
|
||||
|
||||
block_Release( p_block );
|
||||
|
@ -90,7 +90,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
*/
|
||||
static const uint8_t p_sync_le[6] = { 0x72, 0xF8, 0x1F, 0x4E, 0x01, 0x00 };
|
||||
static const uint8_t p_sync_be[6] = { 0xF8, 0x72, 0x4E, 0x1F, 0x00, 0x01 };
|
||||
uint16_t i_frame_size = p_in_buf->i_nb_bytes / 2;
|
||||
uint16_t i_frame_size = p_in_buf->i_buffer / 2;
|
||||
uint8_t * p_in = p_in_buf->p_buffer;
|
||||
uint8_t * p_out = p_out_buf->p_buffer;
|
||||
|
||||
@ -115,6 +115,6 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
AOUT_SPDIF_SIZE - i_frame_size * 2 - 8 );
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = AOUT_SPDIF_SIZE;
|
||||
p_out_buf->i_buffer = AOUT_SPDIF_SIZE;
|
||||
}
|
||||
|
||||
|
@ -303,7 +303,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
&i_sample_rate, &i_bit_rate, &i_frame_length ) )
|
||||
{
|
||||
msg_Warn( p_aout, "libdca couldn't sync on frame" );
|
||||
p_out_buf->i_nb_samples = p_out_buf->i_nb_bytes = 0;
|
||||
p_out_buf->i_nb_samples = p_out_buf->i_buffer = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -361,7 +361,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
}
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = i_bytes_per_block * i;
|
||||
p_out_buf->i_buffer = i_bytes_per_block * i;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@ -459,15 +459,15 @@ static block_t *Convert( filter_t *p_filter, block_t *p_block )
|
||||
aout_filter.output.i_format = p_filter->fmt_out.i_codec;
|
||||
|
||||
in_buf.p_buffer = p_block->p_buffer;
|
||||
in_buf.i_nb_bytes = p_block->i_buffer;
|
||||
in_buf.i_buffer = p_block->i_buffer;
|
||||
in_buf.i_nb_samples = p_block->i_nb_samples;
|
||||
out_buf.p_buffer = p_out->p_buffer;
|
||||
out_buf.i_nb_bytes = p_out->i_buffer;
|
||||
out_buf.i_buffer = p_out->i_buffer;
|
||||
out_buf.i_nb_samples = p_out->i_nb_samples;
|
||||
|
||||
DoWork( (aout_instance_t *)p_filter, &aout_filter, &in_buf, &out_buf );
|
||||
|
||||
p_out->i_buffer = out_buf.i_nb_bytes;
|
||||
p_out->i_buffer = out_buf.i_buffer;
|
||||
p_out->i_nb_samples = out_buf.i_nb_samples;
|
||||
|
||||
block_Release( p_block );
|
||||
|
@ -117,28 +117,28 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
{
|
||||
uint32_t i_ac5_spdif_type = 0;
|
||||
uint16_t i_fz = p_in_buf->i_nb_samples * 4;
|
||||
uint16_t i_frame, i_length = p_in_buf->i_nb_bytes;
|
||||
uint16_t i_frame, i_length = p_in_buf->i_buffer;
|
||||
static const uint8_t p_sync_le[6] = { 0x72, 0xF8, 0x1F, 0x4E, 0x00, 0x00 };
|
||||
static const uint8_t p_sync_be[6] = { 0xF8, 0x72, 0x4E, 0x1F, 0x00, 0x00 };
|
||||
|
||||
if( p_in_buf->i_nb_bytes != p_filter->p_sys->i_frame_size )
|
||||
if( p_in_buf->i_buffer != p_filter->p_sys->i_frame_size )
|
||||
{
|
||||
/* Frame size changed, reset everything */
|
||||
msg_Warn( p_aout, "Frame size changed from %u to %u, "
|
||||
"resetting everything.",
|
||||
p_filter->p_sys->i_frame_size,
|
||||
(unsigned)p_in_buf->i_nb_bytes );
|
||||
(unsigned)p_in_buf->i_buffer );
|
||||
|
||||
p_filter->p_sys->i_frame_size = p_in_buf->i_nb_bytes;
|
||||
p_filter->p_sys->i_frame_size = p_in_buf->i_buffer;
|
||||
p_filter->p_sys->p_buf = realloc( p_filter->p_sys->p_buf,
|
||||
p_in_buf->i_nb_bytes * 3 );
|
||||
p_in_buf->i_buffer * 3 );
|
||||
p_filter->p_sys->i_frames = 0;
|
||||
}
|
||||
|
||||
/* Backup frame */
|
||||
vlc_memcpy( p_filter->p_sys->p_buf + p_in_buf->i_nb_bytes *
|
||||
vlc_memcpy( p_filter->p_sys->p_buf + p_in_buf->i_buffer *
|
||||
p_filter->p_sys->i_frames,
|
||||
p_in_buf->p_buffer, p_in_buf->i_nb_bytes );
|
||||
p_in_buf->p_buffer, p_in_buf->i_buffer );
|
||||
|
||||
p_filter->p_sys->i_frames++;
|
||||
|
||||
@ -150,7 +150,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
|
||||
/* Not enough data */
|
||||
p_out_buf->i_nb_samples = 0;
|
||||
p_out_buf->i_nb_bytes = 0;
|
||||
p_out_buf->i_buffer = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -215,5 +215,5 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
|
||||
p_out_buf->i_pts = p_filter->p_sys->start_date;
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples * 3;
|
||||
p_out_buf->i_nb_bytes = p_out_buf->i_nb_samples * 4;
|
||||
p_out_buf->i_buffer = p_out_buf->i_nb_samples * 4;
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ static void Do_F32ToS16( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
*p_out++ = s24_to_s16_pcm(*p_in++);
|
||||
}
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes / 2;
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer / 2;
|
||||
}
|
||||
|
||||
|
||||
@ -191,7 +191,7 @@ static void Do_S16ToF32( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
}
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer
|
||||
* sizeof(vlc_fixed_t) / sizeof(int16_t);
|
||||
}
|
||||
|
||||
@ -237,5 +237,5 @@ static void Do_U8ToF32( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
}
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes * sizeof(vlc_fixed_t);
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer * sizeof(vlc_fixed_t);
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ static void Do_F32ToFL32( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
}
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes;
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer;
|
||||
}
|
||||
|
||||
static void Do_FL32ToF32( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
@ -192,7 +192,7 @@ static void Do_FL32ToF32( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
}
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes;
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@ -247,7 +247,7 @@ static void Do_FL32ToS16( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
}
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes / 2;
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer / 2;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@ -292,7 +292,7 @@ static void Do_FL32ToS8( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
}
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes / 4;
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer / 4;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@ -337,7 +337,7 @@ static void Do_FL32ToU16( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
}
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes / 2;
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer / 2;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@ -382,7 +382,7 @@ static void Do_FL32ToU8( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
}
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes / 4;
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer / 4;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@ -445,7 +445,7 @@ static void Do_S16ToFL32( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
}
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes * 4 / 2;
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer * 4 / 2;
|
||||
}
|
||||
|
||||
static void Do_S24ToFL32( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
@ -471,7 +471,7 @@ static void Do_S24ToFL32( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
}
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes * 4 / 3;
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer * 4 / 3;
|
||||
}
|
||||
|
||||
static void Do_S32ToFL32( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
@ -490,7 +490,7 @@ static void Do_S32ToFL32( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
}
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes * 4 / 4;
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer * 4 / 4;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@ -561,7 +561,7 @@ static void Do_S16ToFL32_SW( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
*p_out-- = (float)*p_in-- / 32768.0;
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes * 4 / 2;
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer * 4 / 2;
|
||||
}
|
||||
|
||||
static void Do_S24ToFL32_SW( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
@ -593,7 +593,7 @@ static void Do_S24ToFL32_SW( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
}
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes * 4 / 3;
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer * 4 / 3;
|
||||
}
|
||||
|
||||
static void Do_S32ToFL32_SW( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
@ -612,7 +612,7 @@ static void Do_S32ToFL32_SW( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
}
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes * 4 / 4;
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer * 4 / 4;
|
||||
}
|
||||
|
||||
|
||||
@ -657,7 +657,7 @@ static void Do_S8ToFL32( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
}
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes * sizeof(float);
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer * sizeof(float);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@ -701,5 +701,5 @@ static void Do_U8ToFL32( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
}
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes * sizeof(float);
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer * sizeof(float);
|
||||
}
|
||||
|
@ -129,12 +129,12 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
filter_sys_t *p_sys = (filter_sys_t *)p_filter->p_sys;
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_samples * sizeof(vlc_fixed_t) *
|
||||
p_out_buf->i_buffer = p_in_buf->i_nb_samples * sizeof(vlc_fixed_t) *
|
||||
aout_FormatNbChannels( &p_filter->output );
|
||||
|
||||
/* Do the actual decoding now. */
|
||||
mad_stream_buffer( &p_sys->mad_stream, p_in_buf->p_buffer,
|
||||
p_in_buf->i_nb_bytes );
|
||||
p_in_buf->i_buffer );
|
||||
if ( mad_frame_decode( &p_sys->mad_frame, &p_sys->mad_stream ) == -1 )
|
||||
{
|
||||
msg_Dbg( p_aout, "libmad error: %s",
|
||||
@ -151,7 +151,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
if( p_filter->output.i_format == VLC_CODEC_FL32 )
|
||||
{
|
||||
int i;
|
||||
int i_size = p_out_buf->i_nb_bytes / sizeof(float);
|
||||
int i_size = p_out_buf->i_buffer / sizeof(float);
|
||||
|
||||
float * a = (float *)p_out_buf->p_buffer;
|
||||
for ( i = 0 ; i < i_size ; i++ )
|
||||
@ -159,7 +159,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
}
|
||||
else
|
||||
{
|
||||
memset( p_out_buf->p_buffer, 0, p_out_buf->i_nb_bytes );
|
||||
memset( p_out_buf->p_buffer, 0, p_out_buf->i_buffer );
|
||||
}
|
||||
p_sys->i_reject_count--;
|
||||
return;
|
||||
@ -396,17 +396,17 @@ static block_t *Convert( filter_t *p_filter, block_t *p_block )
|
||||
|
||||
in_buf.p_buffer = p_block->p_buffer;
|
||||
in_buf.i_flags = 0;
|
||||
in_buf.i_nb_bytes = p_block->i_buffer;
|
||||
in_buf.i_buffer = p_block->i_buffer;
|
||||
in_buf.i_nb_samples = p_block->i_nb_samples;
|
||||
out_buf.p_buffer = p_out->p_buffer;
|
||||
out_buf.i_nb_bytes = p_out->i_buffer;
|
||||
out_buf.i_buffer = p_out->i_buffer;
|
||||
out_buf.i_nb_samples = p_out->i_nb_samples;
|
||||
|
||||
DoWork( (aout_instance_t *)p_filter, &aout_filter, &in_buf, &out_buf );
|
||||
|
||||
block_Release( p_block );
|
||||
|
||||
p_out->i_buffer = out_buf.i_nb_bytes;
|
||||
p_out->i_buffer = out_buf.i_buffer;
|
||||
p_out->i_nb_samples = out_buf.i_nb_samples;
|
||||
|
||||
return p_out;
|
||||
|
@ -133,7 +133,7 @@ static void Do_F32_S32 (aout_instance_t *aout, aout_filter_t *filter,
|
||||
: "q0", "q1", "memory");
|
||||
|
||||
outbuf->i_nb_samples = inbuf->i_nb_samples;
|
||||
outbuf->i_nb_bytes = inbuf->i_nb_bytes;
|
||||
outbuf->i_buffer = inbuf->i_buffer;
|
||||
(void) aout;
|
||||
}
|
||||
|
||||
@ -196,6 +196,6 @@ static void Do_S32_S16 (aout_instance_t *aout, aout_filter_t *filter,
|
||||
: "q0", "q1", "q2", "q3", "memory");
|
||||
|
||||
outbuf->i_nb_samples = inbuf->i_nb_samples;
|
||||
outbuf->i_nb_bytes = inbuf->i_nb_bytes / 2;
|
||||
outbuf->i_buffer = inbuf->i_buffer / 2;
|
||||
(void) aout;
|
||||
}
|
||||
|
@ -213,7 +213,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
{
|
||||
VLC_UNUSED(p_aout);
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes;
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer;
|
||||
|
||||
EqzFilter( p_filter, (float*)p_out_buf->p_buffer,
|
||||
(float*)p_in_buf->p_buffer, p_in_buf->i_nb_samples,
|
||||
|
@ -179,7 +179,7 @@ static int Open( vlc_object_t *p_this )
|
||||
}
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes;
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer;
|
||||
|
||||
/* Calculate the average power level on this buffer */
|
||||
for( i = 0 ; i < i_samples; i++ )
|
||||
|
@ -189,7 +189,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
{
|
||||
VLC_UNUSED(p_aout);
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes;
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer;
|
||||
|
||||
ProcessEQ( (float*)p_in_buf->p_buffer, (float*)p_out_buf->p_buffer,
|
||||
p_filter->p_sys->p_state,
|
||||
|
@ -204,13 +204,13 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
if( /*p_filter->b_continuity && /--* What difference does it make ? :) */
|
||||
p_sys->i_old_wing &&
|
||||
p_in_buf->i_size >=
|
||||
p_in_buf->i_nb_bytes + p_sys->i_old_wing *
|
||||
p_in_buf->i_buffer + p_sys->i_old_wing *
|
||||
p_filter->input.i_bytes_per_frame )
|
||||
{
|
||||
/* output the whole thing with the samples from last time */
|
||||
memmove( ((float *)(p_in_buf->p_buffer)) +
|
||||
i_nb_channels * p_sys->i_old_wing,
|
||||
p_in_buf->p_buffer, p_in_buf->i_nb_bytes );
|
||||
p_in_buf->p_buffer, p_in_buf->i_buffer );
|
||||
memcpy( p_in_buf->p_buffer, p_sys->p_buf +
|
||||
i_nb_channels * p_sys->i_old_wing,
|
||||
p_sys->i_old_wing *
|
||||
@ -224,7 +224,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
date_Increment( &p_sys->end_date,
|
||||
p_out_buf->i_nb_samples ) - p_out_buf->i_pts;
|
||||
|
||||
p_out_buf->i_nb_bytes = p_out_buf->i_nb_samples *
|
||||
p_out_buf->i_buffer = p_out_buf->i_nb_samples *
|
||||
p_filter->input.i_bytes_per_frame;
|
||||
}
|
||||
p_filter->b_continuity = false;
|
||||
@ -458,7 +458,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
p_out_buf->i_length = date_Increment( &p_sys->end_date,
|
||||
p_out_buf->i_nb_samples ) - p_out_buf->i_pts;
|
||||
|
||||
p_out_buf->i_nb_bytes = p_out_buf->i_nb_samples *
|
||||
p_out_buf->i_buffer = p_out_buf->i_nb_samples *
|
||||
i_nb_channels * sizeof(int32_t);
|
||||
|
||||
}
|
||||
@ -586,17 +586,17 @@ static block_t *Resample( filter_t *p_filter, block_t *p_block )
|
||||
p_filter->p_sys->b_first = false;
|
||||
|
||||
in_buf.p_buffer = p_block->p_buffer;
|
||||
in_buf.i_nb_bytes = in_buf.i_size = p_block->i_buffer;
|
||||
in_buf.i_buffer = in_buf.i_size = p_block->i_buffer;
|
||||
in_buf.i_nb_samples = p_block->i_nb_samples;
|
||||
out_buf.p_buffer = p_out->p_buffer;
|
||||
out_buf.i_nb_bytes = out_buf.i_size = p_out->i_buffer;
|
||||
out_buf.i_buffer = out_buf.i_size = p_out->i_buffer;
|
||||
out_buf.i_nb_samples = p_out->i_nb_samples;
|
||||
|
||||
DoWork( (aout_instance_t *)p_filter, &aout_filter, &in_buf, &out_buf );
|
||||
|
||||
block_Release( p_block );
|
||||
|
||||
p_out->i_buffer = out_buf.i_nb_bytes;
|
||||
p_out->i_buffer = out_buf.i_buffer;
|
||||
p_out->i_nb_samples = out_buf.i_nb_samples;
|
||||
|
||||
return p_out;
|
||||
|
@ -149,11 +149,11 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
{
|
||||
if( p_filter->b_continuity &&
|
||||
p_in_buf->i_size >=
|
||||
p_in_buf->i_nb_bytes + sizeof(float) * i_nb_channels )
|
||||
p_in_buf->i_buffer + sizeof(float) * i_nb_channels )
|
||||
{
|
||||
/* output the whole thing with the last sample from last time */
|
||||
memmove( ((float *)(p_in_buf->p_buffer)) + i_nb_channels,
|
||||
p_in_buf->p_buffer, p_in_buf->i_nb_bytes );
|
||||
p_in_buf->p_buffer, p_in_buf->i_buffer );
|
||||
memcpy( p_in_buf->p_buffer, p_prev_sample,
|
||||
i_nb_channels * sizeof(float) );
|
||||
}
|
||||
@ -161,9 +161,9 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
return;
|
||||
}
|
||||
|
||||
float p_in_orig[p_in_buf->i_nb_bytes / 4], *p_in = p_in_orig;
|
||||
float p_in_orig[p_in_buf->i_buffer / 4], *p_in = p_in_orig;
|
||||
|
||||
vlc_memcpy( p_in, p_in_buf->p_buffer, p_in_buf->i_nb_bytes );
|
||||
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 )
|
||||
@ -234,7 +234,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
p_out_buf->i_length = date_Increment( &p_sys->end_date,
|
||||
p_out_buf->i_nb_samples ) - p_out_buf->i_pts;
|
||||
|
||||
p_out_buf->i_nb_bytes = p_out_buf->i_nb_samples *
|
||||
p_out_buf->i_buffer = p_out_buf->i_nb_samples *
|
||||
i_nb_channels * sizeof(int32_t);
|
||||
}
|
||||
|
||||
@ -336,17 +336,17 @@ static block_t *Resample( filter_t *p_filter, block_t *p_block )
|
||||
aout_filter.b_continuity = false;
|
||||
|
||||
in_buf.p_buffer = p_block->p_buffer;
|
||||
in_buf.i_nb_bytes = p_block->i_buffer;
|
||||
in_buf.i_buffer = p_block->i_buffer;
|
||||
in_buf.i_nb_samples = p_block->i_nb_samples;
|
||||
out_buf.p_buffer = p_out->p_buffer;
|
||||
out_buf.i_nb_bytes = p_out->i_buffer;
|
||||
out_buf.i_buffer = p_out->i_buffer;
|
||||
out_buf.i_nb_samples = p_out->i_nb_samples;
|
||||
|
||||
DoWork( (aout_instance_t *)p_filter, &aout_filter, &in_buf, &out_buf );
|
||||
|
||||
block_Release( p_block );
|
||||
|
||||
p_out->i_buffer = out_buf.i_nb_bytes;
|
||||
p_out->i_buffer = out_buf.i_buffer;
|
||||
p_out->i_nb_samples = out_buf.i_nb_samples;
|
||||
|
||||
return p_out;
|
||||
|
@ -111,7 +111,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
}
|
||||
|
||||
p_out_buf->i_nb_samples = i_out_nb;
|
||||
p_out_buf->i_nb_bytes = i_out_nb * i_sample_bytes;
|
||||
p_out_buf->i_buffer = i_out_nb * i_sample_bytes;
|
||||
p_out_buf->i_pts = p_in_buf->i_pts;
|
||||
p_out_buf->i_length = p_out_buf->i_nb_samples *
|
||||
1000000 / p_filter->output.i_rate;
|
||||
|
@ -101,10 +101,10 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
return;
|
||||
}
|
||||
|
||||
int32_t p_in_orig[p_in_buf->i_nb_bytes / sizeof(int32_t)],
|
||||
int32_t p_in_orig[p_in_buf->i_buffer / sizeof(int32_t)],
|
||||
*p_in = p_in_orig;
|
||||
|
||||
vlc_memcpy( p_in, p_in_buf->p_buffer, p_in_buf->i_nb_bytes );
|
||||
vlc_memcpy( p_in, p_in_buf->p_buffer, p_in_buf->i_buffer );
|
||||
|
||||
for( i_out = i_out_nb ; i_out-- ; )
|
||||
{
|
||||
@ -124,7 +124,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
}
|
||||
|
||||
p_out_buf->i_nb_samples = i_out_nb;
|
||||
p_out_buf->i_nb_bytes = i_out_nb * i_sample_bytes;
|
||||
p_out_buf->i_buffer = i_out_nb * i_sample_bytes;
|
||||
p_out_buf->i_pts = p_in_buf->i_pts;
|
||||
p_out_buf->i_length = p_out_buf->i_nb_samples *
|
||||
1000000 / p_filter->output.i_rate;
|
||||
|
@ -482,8 +482,8 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
aout_filter_sys_t *p = p_filter->p_sys;
|
||||
|
||||
if( p_filter->input.i_rate == p->sample_rate ) {
|
||||
memcpy( p_out_buf->p_buffer, p_in_buf->p_buffer, p_in_buf->i_nb_bytes );
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes;
|
||||
memcpy( p_out_buf->p_buffer, p_in_buf->p_buffer, p_in_buf->i_buffer );
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer;
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
return;
|
||||
}
|
||||
@ -500,7 +500,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
(int)( p->bytes_stride / p->bytes_per_frame ) );
|
||||
}
|
||||
|
||||
size_t i_outsize = calculate_output_buffer_size ( p_filter, p_in_buf->i_nb_bytes );
|
||||
size_t i_outsize = calculate_output_buffer_size ( p_filter, p_in_buf->i_buffer );
|
||||
if( i_outsize > p_out_buf->i_size ) {
|
||||
void *temp = realloc( p->p_buffers[ p->i_buf ], i_outsize );
|
||||
if( temp == NULL )
|
||||
@ -513,9 +513,9 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
}
|
||||
|
||||
size_t bytes_out = transform_buffer( p_filter,
|
||||
p_in_buf->p_buffer, p_in_buf->i_nb_bytes,
|
||||
p_in_buf->p_buffer, p_in_buf->i_buffer,
|
||||
p_out_buf->p_buffer );
|
||||
|
||||
p_out_buf->i_nb_bytes = bytes_out;
|
||||
p_out_buf->i_buffer = bytes_out;
|
||||
p_out_buf->i_nb_samples = bytes_out / p->bytes_per_frame;
|
||||
}
|
||||
|
@ -235,7 +235,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf )
|
||||
{
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes;
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer;
|
||||
|
||||
SpatFilter( p_aout, p_filter, (float*)p_out_buf->p_buffer,
|
||||
(float*)p_in_buf->p_buffer, p_in_buf->i_nb_samples,
|
||||
|
@ -78,7 +78,7 @@ static void DoWork( aout_mixer_t *p_mixer, aout_buffer_t * p_buffer )
|
||||
unsigned i = 0;
|
||||
aout_mixer_input_t * p_input = p_mixer->input[i];
|
||||
int i_nb_channels = aout_FormatNbChannels( &p_mixer->fmt );
|
||||
int i_nb_bytes = p_buffer->i_nb_samples * sizeof(int32_t)
|
||||
int i_buffer = p_buffer->i_nb_samples * sizeof(int32_t)
|
||||
* i_nb_channels;
|
||||
uint8_t * p_in;
|
||||
uint8_t * p_out;
|
||||
@ -100,12 +100,12 @@ static void DoWork( aout_mixer_t *p_mixer, aout_buffer_t * p_buffer )
|
||||
* sizeof(int32_t)
|
||||
* i_nb_channels;
|
||||
|
||||
if ( i_available_bytes < i_nb_bytes )
|
||||
if ( i_available_bytes < i_buffer )
|
||||
{
|
||||
aout_buffer_t * p_old_buffer;
|
||||
|
||||
vlc_memcpy( p_out, p_in, i_available_bytes );
|
||||
i_nb_bytes -= i_available_bytes;
|
||||
i_buffer -= i_available_bytes;
|
||||
p_out += i_available_bytes;
|
||||
|
||||
/* Next buffer */
|
||||
@ -120,8 +120,8 @@ static void DoWork( aout_mixer_t *p_mixer, aout_buffer_t * p_buffer )
|
||||
}
|
||||
else
|
||||
{
|
||||
vlc_memcpy( p_out, p_in, i_nb_bytes );
|
||||
p_input->begin = p_in + i_nb_bytes;
|
||||
vlc_memcpy( p_out, p_in, i_buffer );
|
||||
p_input->begin = p_in + i_buffer;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1328,7 +1328,7 @@ static OSStatus RenderCallbackAnalog( vlc_object_t *_p_aout,
|
||||
|
||||
if( p_buffer != NULL )
|
||||
{
|
||||
uint32_t i_second_mData_bytes = __MIN( p_buffer->i_nb_bytes, ioData->mBuffers[0].mDataByteSize - i_mData_bytes );
|
||||
uint32_t i_second_mData_bytes = __MIN( p_buffer->i_buffer, ioData->mBuffers[0].mDataByteSize - i_mData_bytes );
|
||||
|
||||
vlc_memcpy( (uint8_t *)ioData->mBuffers[0].mData + i_mData_bytes,
|
||||
p_buffer->p_buffer, i_second_mData_bytes );
|
||||
@ -1336,7 +1336,7 @@ static OSStatus RenderCallbackAnalog( vlc_object_t *_p_aout,
|
||||
|
||||
if( i_mData_bytes >= ioData->mBuffers[0].mDataByteSize )
|
||||
{
|
||||
p_sys->i_total_bytes = p_buffer->i_nb_bytes - i_second_mData_bytes;
|
||||
p_sys->i_total_bytes = p_buffer->i_buffer - i_second_mData_bytes;
|
||||
vlc_memcpy( p_sys->p_remainder_buffer,
|
||||
&p_buffer->p_buffer[i_second_mData_bytes],
|
||||
p_sys->i_total_bytes );
|
||||
@ -1394,11 +1394,11 @@ static OSStatus RenderCallbackSPDIF( AudioDeviceID inDevice,
|
||||
#define BUFFER outOutputData->mBuffers[p_sys->i_stream_index]
|
||||
if( p_buffer != NULL )
|
||||
{
|
||||
if( (int)BUFFER.mDataByteSize != (int)p_buffer->i_nb_bytes)
|
||||
msg_Warn( p_aout, "bytesize: %d nb_bytes: %d", (int)BUFFER.mDataByteSize, (int)p_buffer->i_nb_bytes );
|
||||
if( (int)BUFFER.mDataByteSize != (int)p_buffer->i_buffer)
|
||||
msg_Warn( p_aout, "bytesize: %d nb_bytes: %d", (int)BUFFER.mDataByteSize, (int)p_buffer->i_buffer );
|
||||
|
||||
/* move data into output data buffer */
|
||||
vlc_memcpy( BUFFER.mData, p_buffer->p_buffer, p_buffer->i_nb_bytes );
|
||||
vlc_memcpy( BUFFER.mData, p_buffer->p_buffer, p_buffer->i_buffer );
|
||||
aout_BufferFree( p_buffer );
|
||||
}
|
||||
else
|
||||
|
@ -1085,7 +1085,7 @@ static int FillBuffer( aout_instance_t *p_aout, int i_frame,
|
||||
if( p_sys->b_chan_reorder )
|
||||
{
|
||||
/* Do the channel reordering here */
|
||||
aout_ChannelReorder( p_buffer->p_buffer, p_buffer->i_nb_bytes,
|
||||
aout_ChannelReorder( p_buffer->p_buffer, p_buffer->i_buffer,
|
||||
p_sys->i_channels, p_sys->pi_chan_table,
|
||||
p_sys->i_bits_per_sample );
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ static void Play( aout_instance_t * p_aout )
|
||||
|
||||
p_buffer = aout_FifoPop( p_aout, &p_aout->output.fifo );
|
||||
|
||||
if( fwrite( p_buffer->p_buffer, p_buffer->i_nb_bytes, 1,
|
||||
if( fwrite( p_buffer->p_buffer, p_buffer->i_buffer, 1,
|
||||
p_aout->output.p_sys->p_file ) != 1 )
|
||||
{
|
||||
msg_Err( p_aout, "write error (%m)" );
|
||||
@ -332,7 +332,7 @@ static void Play( aout_instance_t * p_aout )
|
||||
if( p_aout->output.p_sys->b_add_wav_header )
|
||||
{
|
||||
/* Update Wave Header */
|
||||
p_aout->output.p_sys->waveh.DataLength += p_buffer->i_nb_bytes;
|
||||
p_aout->output.p_sys->waveh.DataLength += p_buffer->i_buffer;
|
||||
}
|
||||
|
||||
aout_BufferFree( p_buffer );
|
||||
|
@ -660,7 +660,7 @@ static void* OSSThread( vlc_object_t *p_this )
|
||||
if ( p_buffer != NULL )
|
||||
{
|
||||
p_bytes = p_buffer->p_buffer;
|
||||
i_size = p_buffer->i_nb_bytes;
|
||||
i_size = p_buffer->i_buffer;
|
||||
/* This is theoretical ... we'll see next iteration whether
|
||||
* we're drifting */
|
||||
next_date += p_buffer->i_length;
|
||||
|
@ -142,7 +142,7 @@ static int paCallback( const void *inputBuffer, void *outputBuffer,
|
||||
if( p_sys->b_chan_reorder )
|
||||
{
|
||||
/* Do the channel reordering here */
|
||||
aout_ChannelReorder( p_buffer->p_buffer, p_buffer->i_nb_bytes,
|
||||
aout_ChannelReorder( p_buffer->p_buffer, p_buffer->i_buffer,
|
||||
p_sys->i_channels, p_sys->pi_chan_table,
|
||||
p_sys->i_bits_per_sample );
|
||||
}
|
||||
|
@ -467,9 +467,9 @@ static void stream_request_cb(pa_stream *s, size_t length, void *userdata) {
|
||||
|
||||
if ( p_buffer != NULL )
|
||||
{
|
||||
PULSE_DEBUG( "Pulse stream request write buffer %d", p_buffer->i_nb_bytes);
|
||||
pa_stream_write(p_sys->stream, p_buffer->p_buffer, p_buffer->i_nb_bytes, NULL, 0, PA_SEEK_RELATIVE);
|
||||
length -= p_buffer->i_nb_bytes;
|
||||
PULSE_DEBUG( "Pulse stream request write buffer %d", p_buffer->i_buffer);
|
||||
pa_stream_write(p_sys->stream, p_buffer->p_buffer, p_buffer->i_buffer, NULL, 0, PA_SEEK_RELATIVE);
|
||||
length -= p_buffer->i_buffer;
|
||||
aout_BufferFree( p_buffer );
|
||||
}
|
||||
else
|
||||
|
@ -1071,7 +1071,7 @@ static void* WaveOutThread( vlc_object_t *p_this )
|
||||
if( p_buffer && p_sys->b_chan_reorder )
|
||||
{
|
||||
aout_ChannelReorder( p_buffer->p_buffer,
|
||||
p_buffer->i_nb_bytes,
|
||||
p_buffer->i_buffer,
|
||||
p_sys->waveformat.Format.nChannels,
|
||||
p_sys->pi_chan_table,
|
||||
p_sys->waveformat.Format.wBitsPerSample );
|
||||
|
@ -379,7 +379,7 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
|
||||
int16_t *s = (int16_t*)p_out->p_buffer;
|
||||
unsigned int i;
|
||||
|
||||
for( i = 0; i < p_out->i_nb_bytes / 2; i++ )
|
||||
for( i = 0; i < p_out->i_buffer / 2; i++ )
|
||||
{
|
||||
*s++ = p_sys->p_logtos16[*p_block->p_buffer++];
|
||||
p_block->i_buffer--;
|
||||
@ -387,9 +387,9 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy( p_out->p_buffer, p_block->p_buffer, p_out->i_nb_bytes );
|
||||
p_block->p_buffer += p_out->i_nb_bytes;
|
||||
p_block->i_buffer -= p_out->i_nb_bytes;
|
||||
memcpy( p_out->p_buffer, p_block->p_buffer, p_out->i_buffer );
|
||||
p_block->p_buffer += p_out->i_buffer;
|
||||
p_block->i_buffer -= p_out->i_buffer;
|
||||
}
|
||||
|
||||
return p_out;
|
||||
@ -1376,11 +1376,11 @@ static block_t *EncoderEncode( encoder_t *p_enc, aout_buffer_t *p_aout_buf )
|
||||
encoder_sys_t *p_sys = p_enc->p_sys;
|
||||
block_t *p_block = NULL;
|
||||
|
||||
if( !p_aout_buf || !p_aout_buf->i_nb_bytes ) return NULL;
|
||||
if( !p_aout_buf || !p_aout_buf->i_buffer ) return NULL;
|
||||
|
||||
if( p_sys->i_s16tolog )
|
||||
{
|
||||
if( ( p_block = block_New( p_enc, p_aout_buf->i_nb_bytes / 2 ) ) )
|
||||
if( ( p_block = block_New( p_enc, p_aout_buf->i_buffer / 2 ) ) )
|
||||
{
|
||||
int8_t *s = (int8_t*)p_block->p_buffer; // sink
|
||||
int16_t *aout = (int16_t*)p_aout_buf->p_buffer; // source
|
||||
@ -1388,7 +1388,7 @@ static block_t *EncoderEncode( encoder_t *p_enc, aout_buffer_t *p_aout_buf )
|
||||
|
||||
if( p_sys->i_s16tolog == ALAW )
|
||||
{
|
||||
for( i = 0; i < p_aout_buf->i_nb_bytes / 2; i++ )
|
||||
for( i = 0; i < p_aout_buf->i_buffer / 2; i++ )
|
||||
{
|
||||
if( *aout >= 0)
|
||||
*s++ = alaw_encode[*aout / 16];
|
||||
@ -1400,7 +1400,7 @@ static block_t *EncoderEncode( encoder_t *p_enc, aout_buffer_t *p_aout_buf )
|
||||
}
|
||||
else /* ULAW */
|
||||
{
|
||||
for( i = 0; i < p_aout_buf->i_nb_bytes / 2; i++ )
|
||||
for( i = 0; i < p_aout_buf->i_buffer / 2; i++ )
|
||||
{
|
||||
if( *aout >= 0)
|
||||
*s++ = ulaw_encode[*aout / 4];
|
||||
@ -1412,10 +1412,10 @@ static block_t *EncoderEncode( encoder_t *p_enc, aout_buffer_t *p_aout_buf )
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( ( p_block = block_New( p_enc, p_aout_buf->i_nb_bytes ) ) )
|
||||
else if( ( p_block = block_New( p_enc, p_aout_buf->i_buffer ) ) )
|
||||
{
|
||||
memcpy( p_block->p_buffer, p_aout_buf->p_buffer,
|
||||
p_aout_buf->i_nb_bytes );
|
||||
p_aout_buf->i_buffer );
|
||||
}
|
||||
|
||||
if( p_block )
|
||||
|
@ -251,7 +251,7 @@ static aout_buffer_t *SplitBuffer( decoder_t *p_dec )
|
||||
p_sys->p_samples, p_sys->p_context->channels, i_samples,
|
||||
p_sys->pi_extraction, p_dec->fmt_out.audio.i_bitspersample );
|
||||
else
|
||||
memcpy( p_buffer->p_buffer, p_sys->p_samples, p_buffer->i_nb_bytes );
|
||||
memcpy( p_buffer->p_buffer, p_sys->p_samples, p_buffer->i_buffer );
|
||||
|
||||
p_sys->p_samples += i_samples * p_sys->p_context->channels * ( p_dec->fmt_out.audio.i_bitspersample / 8 );
|
||||
p_sys->i_samples -= i_samples;
|
||||
|
@ -1535,7 +1535,7 @@ static block_t *EncodeBlock( encoder_t *p_enc, void *p_data )
|
||||
else
|
||||
{
|
||||
aout_buffer_t *p_aout_buffer = (aout_buffer_t *)p_data;
|
||||
p_block_in = block_New( p_enc, p_aout_buffer->i_nb_bytes );
|
||||
p_block_in = block_New( p_enc, p_aout_buffer->i_buffer );
|
||||
memcpy( p_block_in->p_buffer, p_aout_buffer->p_buffer,
|
||||
p_block_in->i_buffer );
|
||||
|
||||
|
@ -408,7 +408,7 @@ static aout_buffer_t *GetAoutBuffer( decoder_t *p_dec )
|
||||
p_buf = decoder_NewAudioBuffer( p_dec, p_sys->i_frame_length * 4 );
|
||||
if( p_buf == NULL ) return NULL;
|
||||
p_buf->i_nb_samples = p_sys->i_frame_length;
|
||||
p_buf->i_nb_bytes = p_sys->i_frame_size;
|
||||
p_buf->i_buffer = p_sys->i_frame_size;
|
||||
|
||||
p_buf->i_pts = date_Get( &p_sys->end_date );
|
||||
p_buf->i_length = date_Increment( &p_sys->end_date, p_sys->i_frame_length )
|
||||
|
@ -1365,14 +1365,14 @@ static block_t *Encode( encoder_t *p_enc, aout_buffer_t *p_aout_buf )
|
||||
p_sys->i_samples_delay += p_aout_buf->i_nb_samples;
|
||||
|
||||
/* Convert samples to FLAC__int32 */
|
||||
if( p_sys->i_buffer < p_aout_buf->i_nb_bytes * 2 )
|
||||
if( p_sys->i_buffer < p_aout_buf->i_buffer * 2 )
|
||||
{
|
||||
p_sys->p_buffer =
|
||||
realloc( p_sys->p_buffer, p_aout_buf->i_nb_bytes * 2 );
|
||||
p_sys->i_buffer = p_aout_buf->i_nb_bytes * 2;
|
||||
realloc( p_sys->p_buffer, p_aout_buf->i_buffer * 2 );
|
||||
p_sys->i_buffer = p_aout_buf->i_buffer * 2;
|
||||
}
|
||||
|
||||
for( i = 0 ; i < p_aout_buf->i_nb_bytes / 2 ; i++ )
|
||||
for( i = 0 ; i < p_aout_buf->i_buffer / 2 ; i++ )
|
||||
{
|
||||
p_sys->p_buffer[i]= ((int16_t *)p_aout_buf->p_buffer)[i];
|
||||
}
|
||||
|
@ -546,7 +546,7 @@ static aout_buffer_t *GetAoutBuffer( decoder_t *p_dec )
|
||||
p_sys->b_discontinuity = false;
|
||||
|
||||
/* Hack for libmad filter */
|
||||
p_buf->i_nb_bytes = p_sys->i_frame_size + MAD_BUFFER_GUARD;
|
||||
p_buf->i_buffer = p_sys->i_frame_size + MAD_BUFFER_GUARD;
|
||||
|
||||
return p_buf;
|
||||
}
|
||||
|
@ -652,7 +652,7 @@ static aout_buffer_t *DecodeAudio( decoder_t *p_dec, block_t **pp_block )
|
||||
|
||||
memcpy( p_out->p_buffer,
|
||||
&p_sys->out_buffer[2 * p_sys->i_out * p_dec->fmt_out.audio.i_channels],
|
||||
p_out->i_nb_bytes );
|
||||
p_out->i_buffer );
|
||||
|
||||
p_sys->i_out += i_frames;
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ static block_t *GetPCM( encoder_t *p_enc, aout_buffer_t *p_block )
|
||||
if( !p_block ) goto buffered; /* just return a block if we can */
|
||||
|
||||
/* Put the PCM samples sent by VLC in the Fifo */
|
||||
while( p_sys->i_buffer + p_block->i_nb_bytes >= pcm_chunk_size )
|
||||
while( p_sys->i_buffer + p_block->i_buffer >= pcm_chunk_size )
|
||||
{
|
||||
unsigned int i_buffer = 0;
|
||||
p_pcm_block = block_New( p_enc, pcm_chunk_size );
|
||||
@ -144,20 +144,20 @@ static block_t *GetPCM( encoder_t *p_enc, aout_buffer_t *p_block )
|
||||
p_block->p_buffer, pcm_chunk_size - i_buffer );
|
||||
p_block->p_buffer += pcm_chunk_size - i_buffer;
|
||||
|
||||
p_block->i_nb_bytes -= pcm_chunk_size - i_buffer;
|
||||
p_block->i_buffer -= pcm_chunk_size - i_buffer;
|
||||
|
||||
block_FifoPut( p_sys->p_fifo, p_pcm_block );
|
||||
}
|
||||
|
||||
/* We hadn't enough data to make a block, put it in standby */
|
||||
if( p_block->i_nb_bytes )
|
||||
if( p_block->i_buffer )
|
||||
{
|
||||
uint8_t *p_tmp;
|
||||
|
||||
if( p_sys->i_buffer > 0 )
|
||||
p_tmp = realloc( p_sys->p_buffer, p_block->i_nb_bytes + p_sys->i_buffer );
|
||||
p_tmp = realloc( p_sys->p_buffer, p_block->i_buffer + p_sys->i_buffer );
|
||||
else
|
||||
p_tmp = malloc( p_block->i_nb_bytes );
|
||||
p_tmp = malloc( p_block->i_buffer );
|
||||
|
||||
if( !p_tmp )
|
||||
{
|
||||
@ -168,10 +168,10 @@ static block_t *GetPCM( encoder_t *p_enc, aout_buffer_t *p_block )
|
||||
}
|
||||
p_sys->p_buffer = p_tmp;
|
||||
vlc_memcpy( p_sys->p_buffer + p_sys->i_buffer,
|
||||
p_block->p_buffer, p_block->i_nb_bytes );
|
||||
p_block->p_buffer, p_block->i_buffer );
|
||||
|
||||
p_sys->i_buffer += p_block->i_nb_bytes;
|
||||
p_block->i_nb_bytes = 0;
|
||||
p_sys->i_buffer += p_block->i_buffer;
|
||||
p_block->i_buffer = 0;
|
||||
}
|
||||
|
||||
buffered:
|
||||
@ -183,7 +183,7 @@ static block_t *EncodeFrame( encoder_t *p_enc, aout_buffer_t *p_block )
|
||||
{
|
||||
block_t *p_pcm_block;
|
||||
block_t *p_chain = NULL;
|
||||
unsigned int i_samples = p_block->i_nb_bytes >> 2 /* s16l stereo */;
|
||||
unsigned int i_samples = p_block->i_buffer >> 2 /* s16l stereo */;
|
||||
mtime_t start_date = p_block->i_pts;
|
||||
start_date -= (mtime_t)i_samples * (mtime_t)1000000 / (mtime_t)p_enc->fmt_out.audio.i_rate;
|
||||
|
||||
|
@ -683,7 +683,7 @@ static aout_buffer_t *DecodeRtpSpeexPacket( decoder_t *p_dec, block_t **pp_block
|
||||
*/
|
||||
p_aout_buffer = decoder_NewAudioBuffer( p_dec,
|
||||
p_sys->p_header->frame_size );
|
||||
if ( !p_aout_buffer || p_aout_buffer->i_nb_bytes == 0 )
|
||||
if ( !p_aout_buffer || p_aout_buffer->i_buffer == 0 )
|
||||
{
|
||||
msg_Err(p_dec, "Oops: No new buffer was returned!");
|
||||
return NULL;
|
||||
|
@ -105,8 +105,8 @@ static aout_buffer_t *SplitBuffer( decoder_t *p_dec )
|
||||
p_buffer->i_length = date_Increment( &p_sys->end_date, i_samples )
|
||||
- p_buffer->i_pts;
|
||||
|
||||
memcpy( p_buffer->p_buffer, p_sys->p_samples, p_buffer->i_nb_bytes );
|
||||
p_sys->p_samples += p_buffer->i_nb_bytes;
|
||||
memcpy( p_buffer->p_buffer, p_sys->p_samples, p_buffer->i_buffer );
|
||||
p_sys->p_samples += p_buffer->i_buffer;
|
||||
p_sys->i_samples -= i_samples;
|
||||
|
||||
return p_buffer;
|
||||
|
@ -150,11 +150,11 @@ static void Play( void * _p_aout, void * _p_buffer, size_t i_size,
|
||||
if( p_aout_buffer != NULL )
|
||||
{
|
||||
vlc_memcpy( p_buffer, p_aout_buffer->p_buffer,
|
||||
MIN( i_size, p_aout_buffer->i_nb_bytes ) );
|
||||
if( p_aout_buffer->i_nb_bytes < i_size )
|
||||
MIN( i_size, p_aout_buffer->i_buffer ) );
|
||||
if( p_aout_buffer->i_buffer < i_size )
|
||||
{
|
||||
vlc_memset( p_buffer + p_aout_buffer->i_nb_bytes,
|
||||
0, i_size - p_aout_buffer->i_nb_bytes );
|
||||
vlc_memset( p_buffer + p_aout_buffer->i_buffer,
|
||||
0, i_size - p_aout_buffer->i_buffer );
|
||||
}
|
||||
aout_BufferFree( p_aout_buffer );
|
||||
}
|
||||
|
@ -294,7 +294,7 @@ static void* QNXaoutThread( vlc_object_t *p_this )
|
||||
if ( p_buffer != NULL )
|
||||
{
|
||||
p_bytes = p_buffer->p_buffer;
|
||||
i_size = p_buffer->i_nb_bytes;
|
||||
i_size = p_buffer->i_buffer;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1308,7 +1308,7 @@ static int transcode_audio_process( sout_stream_t *p_stream,
|
||||
}
|
||||
|
||||
p_audio_block = p_audio_buf->p_sys;
|
||||
p_audio_block->i_buffer = p_audio_buf->i_nb_bytes;
|
||||
p_audio_block->i_buffer = p_audio_buf->i_buffer;
|
||||
p_audio_block->i_dts = p_audio_block->i_pts =
|
||||
p_audio_buf->i_pts;
|
||||
p_audio_block->i_length = p_audio_buf->i_length;
|
||||
@ -1325,7 +1325,7 @@ static int transcode_audio_process( sout_stream_t *p_stream,
|
||||
assert( p_audio_block );
|
||||
|
||||
p_audio_buf->p_buffer = p_audio_block->p_buffer;
|
||||
p_audio_buf->i_nb_bytes = p_audio_block->i_buffer;
|
||||
p_audio_buf->i_buffer = p_audio_block->i_buffer;
|
||||
p_audio_buf->i_nb_samples = p_audio_block->i_nb_samples;
|
||||
p_audio_buf->i_pts = p_audio_block->i_dts;
|
||||
p_audio_buf->i_length = p_audio_block->i_length;
|
||||
@ -1370,7 +1370,7 @@ static aout_buffer_t *audio_new_buffer( decoder_t *p_dec, int i_samples )
|
||||
p_buffer->p_sys = p_block = block_New( p_dec, i_size );
|
||||
|
||||
p_buffer->p_buffer = p_block->p_buffer;
|
||||
p_buffer->i_size = p_buffer->i_nb_bytes = p_block->i_buffer;
|
||||
p_buffer->i_size = p_buffer->i_buffer = p_block->i_buffer;
|
||||
p_buffer->i_nb_samples = i_samples;
|
||||
p_block->i_nb_samples = i_samples;
|
||||
|
||||
|
@ -221,7 +221,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
block_t *p_block;
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes;
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer;
|
||||
|
||||
/* Queue sample */
|
||||
vlc_mutex_lock( &p_sys->p_thread->lock );
|
||||
@ -231,13 +231,13 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
|
||||
return;
|
||||
}
|
||||
|
||||
p_block = block_New( p_sys->p_thread, p_in_buf->i_nb_bytes );
|
||||
p_block = block_New( p_sys->p_thread, p_in_buf->i_buffer );
|
||||
if( !p_block )
|
||||
{
|
||||
vlc_mutex_unlock( &p_sys->p_thread->lock );
|
||||
return;
|
||||
}
|
||||
memcpy( p_block->p_buffer, p_in_buf->p_buffer, p_in_buf->i_nb_bytes );
|
||||
memcpy( p_block->p_buffer, p_in_buf->p_buffer, p_in_buf->i_buffer );
|
||||
p_block->i_pts = p_in_buf->i_pts;
|
||||
|
||||
p_sys->p_thread->pp_blocks[p_sys->p_thread->i_blocks++] = p_block;
|
||||
|
@ -259,7 +259,7 @@ static void DoWork( aout_instance_t *p_aout, aout_filter_t *p_filter,
|
||||
projectm_thread_t *p_thread = p_filter->p_sys->p_thread;
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes;
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer;
|
||||
|
||||
vlc_mutex_lock( &p_thread->lock );
|
||||
if( p_thread->i_buffer_size > 0 )
|
||||
|
@ -343,7 +343,7 @@ static void DoWork( aout_instance_t *p_aout, aout_filter_t *p_filter,
|
||||
int i;
|
||||
|
||||
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
|
||||
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes *
|
||||
p_out_buf->i_buffer = p_in_buf->i_buffer *
|
||||
aout_FormatNbChannels( &p_filter->output ) /
|
||||
aout_FormatNbChannels( &p_filter->input );
|
||||
|
||||
|
@ -269,7 +269,7 @@ aout_buffer_t * aout_DecNewBuffer( aout_input_t * p_input,
|
||||
/* This necessarily allocates in the heap. */
|
||||
p_buffer = aout_BufferAlloc( &p_input->input_alloc, duration, NULL );
|
||||
if( p_buffer != NULL )
|
||||
p_buffer->i_nb_bytes = i_nb_samples * p_input->input.i_bytes_per_frame
|
||||
p_buffer->i_buffer = i_nb_samples * p_input->input.i_bytes_per_frame
|
||||
/ p_input->input.i_frame_length;
|
||||
|
||||
/* Suppose the decoder doesn't have more than one buffered buffer */
|
||||
@ -327,9 +327,9 @@ int aout_DecPlay( aout_instance_t * p_aout, aout_input_t * p_input,
|
||||
|
||||
p_new_buffer = aout_BufferAlloc( &p_input->input_alloc, duration, NULL);
|
||||
vlc_memcpy( p_new_buffer->p_buffer, p_buffer->p_buffer,
|
||||
p_buffer->i_nb_bytes );
|
||||
p_buffer->i_buffer );
|
||||
p_new_buffer->i_nb_samples = p_buffer->i_nb_samples;
|
||||
p_new_buffer->i_nb_bytes = p_buffer->i_nb_bytes;
|
||||
p_new_buffer->i_buffer = p_buffer->i_buffer;
|
||||
p_new_buffer->i_pts = p_buffer->i_pts;
|
||||
p_new_buffer->i_length = p_buffer->i_length;
|
||||
aout_BufferFree( p_buffer );
|
||||
|
@ -356,7 +356,7 @@ void aout_FiltersPlay( aout_instance_t * p_aout,
|
||||
p_output_buffer->i_pts = (*pp_input_buffer)->i_pts;
|
||||
p_output_buffer->i_length = (*pp_input_buffer)->i_length;
|
||||
|
||||
/* Please note that p_output_buffer->i_nb_samples & i_nb_bytes
|
||||
/* Please note that p_output_buffer->i_nb_samples & i_buffer
|
||||
* shall be set by the filter plug-in. */
|
||||
if( (*pp_input_buffer)->i_nb_samples > 0 )
|
||||
{
|
||||
@ -365,7 +365,7 @@ void aout_FiltersPlay( aout_instance_t * p_aout,
|
||||
}
|
||||
else
|
||||
{
|
||||
p_output_buffer->i_nb_bytes = 0;
|
||||
p_output_buffer->i_buffer = 0;
|
||||
p_output_buffer->i_nb_samples = 0;
|
||||
}
|
||||
|
||||
|
@ -287,7 +287,7 @@ static int MixBuffer( aout_instance_t * p_aout )
|
||||
{
|
||||
/* Additionally check that p_first_byte_to_mix is well
|
||||
* located. */
|
||||
mtime_t i_nb_bytes = (start_date - p_buffer->i_pts)
|
||||
mtime_t i_buffer = (start_date - p_buffer->i_pts)
|
||||
* p_aout->p_mixer->fmt.i_bytes_per_frame
|
||||
* p_aout->p_mixer->fmt.i_rate
|
||||
/ p_aout->p_mixer->fmt.i_frame_length
|
||||
@ -300,18 +300,18 @@ static int MixBuffer( aout_instance_t * p_aout )
|
||||
}
|
||||
mixer_nb_bytes = p_input->mixer.begin - p_buffer->p_buffer;
|
||||
|
||||
if ( !((i_nb_bytes + p_aout->p_mixer->fmt.i_bytes_per_frame
|
||||
if ( !((i_buffer + p_aout->p_mixer->fmt.i_bytes_per_frame
|
||||
> mixer_nb_bytes) &&
|
||||
(i_nb_bytes < p_aout->p_mixer->fmt.i_bytes_per_frame
|
||||
(i_buffer < p_aout->p_mixer->fmt.i_bytes_per_frame
|
||||
+ mixer_nb_bytes)) )
|
||||
{
|
||||
msg_Warn( p_aout, "mixer start isn't output start (%"PRId64")",
|
||||
i_nb_bytes - mixer_nb_bytes );
|
||||
i_buffer - mixer_nb_bytes );
|
||||
|
||||
/* Round to the nearest multiple */
|
||||
i_nb_bytes /= p_aout->p_mixer->fmt.i_bytes_per_frame;
|
||||
i_nb_bytes *= p_aout->p_mixer->fmt.i_bytes_per_frame;
|
||||
if( i_nb_bytes < 0 )
|
||||
i_buffer /= p_aout->p_mixer->fmt.i_bytes_per_frame;
|
||||
i_buffer *= p_aout->p_mixer->fmt.i_bytes_per_frame;
|
||||
if( i_buffer < 0 )
|
||||
{
|
||||
/* Is it really the best way to do it ? */
|
||||
aout_lock_output_fifo( p_aout );
|
||||
@ -321,7 +321,7 @@ static int MixBuffer( aout_instance_t * p_aout )
|
||||
break;
|
||||
}
|
||||
|
||||
p_input->mixer.begin = p_buffer->p_buffer + i_nb_bytes;
|
||||
p_input->mixer.begin = p_buffer->p_buffer + i_buffer;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -349,7 +349,7 @@ static int MixBuffer( aout_instance_t * p_aout )
|
||||
if ( p_aout->p_mixer->allocation.b_alloc )
|
||||
{
|
||||
p_output_buffer->i_nb_samples = p_aout->output.i_nb_samples;
|
||||
p_output_buffer->i_nb_bytes = p_aout->output.i_nb_samples
|
||||
p_output_buffer->i_buffer = p_aout->output.i_nb_samples
|
||||
* p_aout->p_mixer->fmt.i_bytes_per_frame
|
||||
/ p_aout->p_mixer->fmt.i_frame_length;
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ void aout_OutputPlay( aout_instance_t * p_aout, aout_buffer_t * p_buffer )
|
||||
p_aout->output.i_nb_filters,
|
||||
&p_buffer );
|
||||
|
||||
if( p_buffer->i_nb_bytes == 0 )
|
||||
if( p_buffer->i_buffer == 0 )
|
||||
{
|
||||
aout_BufferFree( p_buffer );
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user