aout_instance_t * __aout_New( vlc_object_t * p_parent )
{
aout_instance_t * p_aout;
- vlc_value_t val;
/* Allocate descriptor. */
p_aout = vlc_object_create( p_parent, VLC_OBJECT_AOUT );
p_aout->output.b_starving = 1;
var_Create( p_aout, "intf-change", VLC_VAR_BOOL );
- val.b_bool = true;
- var_Set( p_aout, "intf-change", val );
+ var_SetBool( p_aout, "intf-change", true );
vlc_object_set_destructor( p_aout, aout_Destructor );
/* Enforce the continuity of the stream. */
if ( date_Get( &p_fifo->end_date ) )
{
- p_buffer->start_date = date_Get( &p_fifo->end_date );
- p_buffer->end_date = date_Increment( &p_fifo->end_date,
+ p_buffer->i_pts = date_Get( &p_fifo->end_date );
+ p_buffer->i_length = date_Increment( &p_fifo->end_date,
p_buffer->i_nb_samples );
+ p_buffer->i_length -= p_buffer->i_pts;
}
else
{
- date_Set( &p_fifo->end_date, p_buffer->end_date );
+ date_Set( &p_fifo->end_date, p_buffer->i_pts + p_buffer->i_length );
}
}
p_buffer = p_fifo->p_first;
while ( p_buffer != NULL )
{
- p_buffer->start_date += difference;
- p_buffer->end_date += difference;
+ p_buffer->i_pts += difference;
p_buffer = p_buffer->p_next;
}
}
{
(void)p_aout;
AOUT_ASSERT_FIFO_LOCKED;
- return p_fifo->p_first ? p_fifo->p_first->start_date : 0;
+ return p_fifo->p_first ? p_fifo->p_first->i_pts : 0;
}
/*****************************************************************************
}
return i_out == i_channels;
}
+
+/*****************************************************************************
+ * aout_BufferAlloc:
+ *****************************************************************************/
+
+aout_buffer_t *aout_BufferAlloc(aout_alloc_t *allocation, mtime_t microseconds,
+ aout_buffer_t *old_buffer)
+{
+ if ( !allocation->b_alloc )
+ {
+ return old_buffer;
+ }
+
+ size_t i_alloc_size = (int)( (uint64_t)allocation->i_bytes_per_sec
+ * (microseconds) / 1000000 + 1 );
+
+ return block_Alloc( i_alloc_size );
+}