- aout_buffer_t * p_buffer;
- int i_tmp, i_size;
- byte_t * p_bytes;
-
- if( !p_sys->b_initialized )
- {
- msleep( THREAD_SLEEP );
- continue;
- }
-
- /* Get the presentation date of the next write() operation. It
- * is equal to the current date + latency */
- p_buffer = aout_OutputNextBuffer( p_aout, mdate() + p_sys->latency,
- VLC_FALSE );
-
- if ( p_buffer != NULL )
- {
- p_bytes = p_buffer->p_buffer;
- i_size = p_buffer->i_nb_bytes;
- }
- else
- {
- i_size = p_sys->i_size / p_aout->output.output.i_frame_length
- * p_aout->output.output.i_bytes_per_frame;
- p_bytes = alloca( i_size );
- memset( p_bytes, 0, i_size );
- }
-
- i_tmp = arts_write( p_sys->stream, p_bytes, i_size );
+ i_tmp = arts_write( p_sys->stream, p_buffer->p_buffer,
+ p_buffer->i_nb_bytes );