-#define aout_BufferAlloc( p_alloc, i_nb_usec, p_previous_buffer, \
- p_new_buffer ) \
- if ( (p_alloc)->i_alloc_type == AOUT_ALLOC_NONE ) \
- { \
- (p_new_buffer) = p_previous_buffer; \
- } \
- else \
- { \
- int i_alloc_size, i_alloc_type; \
- i_alloc_size = (int)( (uint64_t)(p_alloc)->i_bytes_per_sec \
- * (i_nb_usec) / 1000000 + 1 ); \
- ALLOCA_TEST( p_alloc, p_new_buffer ) \
- { \
- (p_new_buffer) = malloc( i_alloc_size + sizeof(aout_buffer_t) );\
- i_alloc_type = AOUT_ALLOC_HEAP; \
- } \
- if ( p_new_buffer != NULL ) \
- { \
- (p_new_buffer)->i_alloc_type = i_alloc_type; \
- (p_new_buffer)->i_size = i_alloc_size; \
- (p_new_buffer)->p_buffer = (uint8_t *)(p_new_buffer) \
- + sizeof(aout_buffer_t); \
- (p_new_buffer)->b_discontinuity = false; \
- if ( (p_previous_buffer) != NULL ) \
- { \
- (p_new_buffer)->start_date = \
- ((aout_buffer_t *)p_previous_buffer)->start_date;\
- (p_new_buffer)->end_date = \
- ((aout_buffer_t *)p_previous_buffer)->end_date; \
- } \
- } \
- /* we'll keep that for a while --Meuuh */ \
- /* else printf("%s:%d\n", __FILE__, __LINE__); */ \
- }
+block_t *aout_FilterBufferNew( filter_t *, int );
+
+/** an input stream for the audio output */
+struct aout_input_t
+{
+ /* When this lock is taken, the pipeline cannot be changed by a
+ * third-party. */
+ vlc_mutex_t lock;
+
+ audio_sample_format_t input;
+ aout_alloc_t input_alloc;
+
+ /* pre-filters */
+ filter_t * pp_filters[AOUT_MAX_FILTERS];
+ int i_nb_filters;
+
+ filter_t * p_playback_rate_filter;
+
+ /* resamplers */
+ filter_t * pp_resamplers[AOUT_MAX_FILTERS];
+ int i_nb_resamplers;
+ int i_resampling_type;
+ mtime_t i_resamp_start_date;
+ int i_resamp_start_drift;
+
+ /* Mixer information */
+ audio_replay_gain_t replay_gain;
+
+ /* If b_restart == 1, the input pipeline will be re-created. */
+ bool b_restart;
+
+ /* If b_error == 1, there is no input pipeline. */
+ bool b_error;
+
+ /* Did we just change the output format? (expect buffer inconsistencies) */
+ bool b_changed;
+
+ /* last rate from input */
+ int i_last_input_rate;
+
+ /* */
+ int i_buffer_lost;
+
+ /* */
+ bool b_paused;
+ mtime_t i_pause_date;
+
+ /* */
+ bool b_recycle_vout;
+ aout_request_vout_t request_vout;
+
+ /* */
+ aout_mixer_input_t mixer;
+ };