/* Write block */
if( !p_sys->p_write_list && !p_sys->p_read_list &&
- p_sys->p_fifo->i_size < TIMESHIFT_FIFO_MAX )
+ block_FifoSize( p_sys->p_fifo ) < TIMESHIFT_FIFO_MAX )
{
/* If there isn't too much timeshifted data,
* write directly to FIFO */
block_Release( p_block );
/* Read from file to fill up the fifo */
- while( p_sys->p_fifo->i_size < TIMESHIFT_FIFO_MIN &&
+ while( block_FifoSize( p_sys->p_fifo ) < TIMESHIFT_FIFO_MIN &&
!p_access->b_die )
{
p_block = ReadBlockFromFile( p_access );
msg_Dbg( p_access, "timeshift: no more input data" );
while( !p_access->b_die &&
- (p_sys->p_read_list || p_sys->p_fifo->i_size) )
+ (p_sys->p_read_list || block_FifoSize( p_sys->p_fifo ) ) )
{
/* Read from file to fill up the fifo */
- while( p_sys->p_fifo->i_size < TIMESHIFT_FIFO_MIN &&
+ while( block_FifoSize( p_sys->p_fifo ) < TIMESHIFT_FIFO_MIN &&
!p_access->b_die && p_sys->p_read_list )
{
p_block = ReadBlockFromFile( p_access );
sout_access_out_sys_t *p_sys = p_access->p_sys;
block_t *p_buffer;
- while ( p_sys->p_thread->p_empty_blocks->i_depth > MAX_EMPTY_BLOCKS )
+ while ( block_FifoCount( p_sys->p_thread->p_empty_blocks ) > MAX_EMPTY_BLOCKS )
{
p_buffer = block_FifoGet( p_sys->p_thread->p_empty_blocks );
block_Release( p_buffer );
}
- if( p_sys->p_thread->p_empty_blocks->i_depth == 0 )
+ if( block_FifoCount( p_sys->p_thread->p_empty_blocks ) == 0 )
{
p_buffer = block_New( p_access->p_sout, p_sys->i_mtu );
}
/* We don't really need to have anything in the SPU fifo */
if( p_mux->pp_inputs[i]->p_fmt->i_cat == SPU_ES &&
- p_fifo->i_depth == 0 ) continue;
+ block_FifoCount( p_fifo ) == 0 ) continue;
- if( p_fifo->i_depth )
+ if( block_FifoCount( p_fifo ) )
{
block_t *p_buf;
sout_input_t *p_input = p_mux->pp_inputs[i];
block_t *p_data;
- if( p_input->p_fifo->i_depth <= 0 )
+ if( block_FifoCount( p_input->p_fifo ) <= 0 )
{
if( p_input->p_fmt->i_cat == AUDIO_ES ||
p_input->p_fmt->i_cat == VIDEO_ES )
p_stream = &p_sys->stream[i_stream];
p_fifo = p_mux->pp_inputs[i]->p_fifo;
- i_count = p_fifo->i_depth;
+ i_count = block_FifoCount( p_fifo );
while( i_count > 1 )
{
avi_idx1_entry_t *p_idx;
block_t *p_data;
p_data = block_FifoGet( p_fifo );
- if( p_fifo->i_depth > 0 )
+ if( block_FifoCount( p_fifo ) > 0 )
{
block_t *p_next = block_FifoShow( p_fifo );
p_data->i_length = p_next->i_dts - p_data->i_dts;
}
p_fifo = p_mux->pp_inputs[i]->p_fifo;
- i_count = p_fifo->i_depth;
+ i_count = block_FifoCount( p_fifo );
while( i_count > 0 )
{
block_t *p_data = block_FifoGet( p_fifo );
block_fifo_t *p_fifo = p_mux->pp_inputs[i]->p_fifo;
block_t *p_buf;
- if( p_fifo->i_depth <= 1 )
+ if( Block_FifoCount( p_fifo ) <= 1 )
{
if( p_mux->pp_inputs[i]->p_fmt->i_cat != SPU_ES )
{
if( p_stream->fmt.i_cat != SPU_ES )
{
/* Fix length of the sample */
- if( p_input->p_fifo->i_depth > 0 )
+ if( block_FifoCount( p_input->p_fifo ) > 0 )
{
block_t *p_next = block_FifoShow( p_input->p_fifo );
int64_t i_diff = p_next->i_dts - p_data->i_dts;
sout_input_t *p_input = p_mux->pp_inputs[i];
block_t *p_data;
- if( p_input->p_fifo->i_depth <= 0 )
+ if( block_FifoCount( p_input->p_fifo ) <= 0 )
{
if( p_input->p_fmt->i_cat == AUDIO_ES ||
p_input->p_fmt->i_cat == VIDEO_ES )
p_pcr_stream->i_pes_dts + p_pcr_stream->i_pes_length )
{
/* Need more data */
- if( p_input->p_fifo->i_depth <= 1 )
+ if( block_FifoCount( p_input->p_fifo ) <= 1 )
{
if( p_input->p_fmt->i_cat == AUDIO_ES ||
p_input->p_fmt->i_cat == VIDEO_ES )
/* We need more data */
return VLC_SUCCESS;
}
- else if( p_input->p_fifo->i_depth <= 0 )
+ else if( block_FifoCount( p_input->p_fifo ) <= 0 )
{
/* spu, only one packet is needed */
continue;
else
p_data = FixPES( p_mux, p_input->p_fifo );
- if( p_input->p_fifo->i_depth > 0 &&
+ if( block_FifoCount( p_input->p_fifo ) > 0 &&
p_input->p_fmt->i_cat != SPU_ES )
{
block_t *p_next = block_FifoShow( p_input->p_fifo );
if( !p_mux->i_nb_inputs ) return VLC_SUCCESS;
p_fifo = p_mux->pp_inputs[0]->p_fifo;
- i_count = p_fifo->i_depth;
+ i_count = block_FifoCount( p_fifo );
while( i_count > 0 )
{
block_t *p_length = block_New( p_mux, 25 );
/* We don't really need to have anything in the SPU fifo */
if( p_mux->pp_inputs[i]->p_fmt->i_cat == SPU_ES &&
- p_fifo->i_depth == 0 ) continue;
+ block_FifoCount( p_fifo ) == 0 ) continue;
- if( p_fifo->i_depth )
+ if( block_FifoCount( p_fifo ) )
{
block_t *p_buf;
{
if( !p_stream->b_new )
{
- while( p_input->p_fifo->i_depth ) MuxBlock( p_mux, p_input );
+ while( block_FifoCount( p_input->p_fifo ) )
+ MuxBlock( p_mux, p_input );
}
if( !p_stream->b_new &&
p_sys->b_header = VLC_FALSE;
p_input = p_mux->pp_inputs[0];
- while( p_input->p_fifo->i_depth > 0 )
+ while( block_FifoCount( p_input->p_fifo ) > 0 )
{
block_t *p_block = block_FifoGet( p_input->p_fifo );
p_sys->i_data += p_block->i_buffer;
{
/* FIXME !!!!! */
while( !p_dec->b_die && !p_dec->b_error &&
- p_dec->p_owner->p_fifo->i_depth > 10 )
+ block_FifoCount( p_dec->p_owner->p_fifo ) > 10 )
{
msleep( 1000 );
}
}
- else if( p_dec->p_owner->p_fifo->i_size > 50000000 /* 50 MB */ )
+ else if( block_FifoSize( p_dec->p_owner->p_fifo ) > 50000000 /* 50 MB */ )
{
/* FIXME: ideally we would check the time amount of data
* in the fifo instead of its size. */
vlc_bool_t input_DecoderEmpty( decoder_t * p_dec )
{
- if( p_dec->p_owner->b_own_thread && p_dec->p_owner->p_fifo->i_depth > 0 )
+ if( p_dec->p_owner->b_own_thread
+ && block_FifoCount( p_dec->p_owner->p_fifo ) > 0 )
{
return VLC_FALSE;
}
*/
static void DeleteDecoder( decoder_t * p_dec )
{
- msg_Dbg( p_dec, "killing decoder fourcc `%4.4s', %d PES in FIFO",
+ msg_Dbg( p_dec, "killing decoder fourcc `%4.4s', %u PES in FIFO",
(char*)&p_dec->fmt_in.i_codec,
- p_dec->p_owner->p_fifo->i_depth );
+ (unsigned)block_FifoCount( p_dec->p_owner->p_fifo ) );
/* Free all packets still in the decoder fifo. */
block_FifoEmpty( p_dec->p_owner->p_fifo );
{
int i_index;
- if( p_mux->b_waiting_stream && p_input->p_fifo->i_depth > 0 )
+ if( p_mux->b_waiting_stream
+ && block_FifoCount( p_input->p_fifo ) > 0 )
{
/* We stop waiting, and call the muxer for taking care of the data
* before we remove this es */