1 /*****************************************************************************
2 * headphone.c : headphone virtual spatialization channel mixer module
3 * -> gives the feeling of a real room with a simple headphone
4 *****************************************************************************
5 * Copyright (C) 2002-2006 the VideoLAN team
8 * Authors: Boris Dorès <babal@via.ecp.fr>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 /*****************************************************************************
27 *****************************************************************************/
28 #include <stdlib.h> /* malloc(), free() */
30 #include <math.h> /* sqrt */
33 #include <audio_output.h>
34 #include <aout_internal.h>
35 #include <vlc_filter.h>
36 #include <vlc_block.h>
38 /*****************************************************************************
40 *****************************************************************************/
41 static int Create ( vlc_object_t * );
42 static void Destroy ( vlc_object_t * );
44 static void DoWork ( aout_instance_t *, aout_filter_t *, aout_buffer_t *,
48 static int OpenFilter ( vlc_object_t * );
49 static void CloseFilter( vlc_object_t * );
50 static block_t *Convert( filter_t *, block_t * );
52 /*****************************************************************************
54 *****************************************************************************/
55 #define MODULE_DESCRIPTION N_ ( \
56 "This effect gives you the feeling that you are standing in a room " \
57 "with a complete 7.1 speaker set when using only a headphone, " \
58 "providing a more realistic sound experience. It should also be " \
59 "more comfortable and less tiring when listening to music for " \
60 "long periods of time.\nIt works with any source format from mono " \
63 #define HEADPHONE_DIM_TEXT N_("Characteristic dimension")
64 #define HEADPHONE_DIM_LONGTEXT N_( \
65 "Distance between front left speaker and listener in meters.")
67 #define HEADPHONE_COMPENSATE_TEXT N_("Compensate delay")
68 #define HEADPHONE_COMPENSATE_LONGTEXT N_( \
69 "The delay which is introduced by the physical algorithm may "\
70 "sometimes be disturbing for the synchronization between lips-movement "\
71 "and speech. In case, turn this on to compensate.")
73 #define HEADPHONE_DOLBY_TEXT N_("No decoding of Dolby Surround")
74 #define HEADPHONE_DOLBY_LONGTEXT N_( \
75 "Dolby Surround encoded streams won't be decoded before being " \
76 "processed by this filter. Enabling this setting is not recommended.")
79 set_description( N_("Headphone virtual spatialization effect") );
80 set_shortname( _("Headphone effect") );
81 set_help( MODULE_DESCRIPTION );
82 set_category( CAT_AUDIO );
83 set_subcategory( SUBCAT_AUDIO_AFILTER );
85 add_integer( "headphone-dim", 10, NULL, HEADPHONE_DIM_TEXT,
86 HEADPHONE_DIM_LONGTEXT, VLC_FALSE );
87 add_bool( "headphone-compensate", 0, NULL, HEADPHONE_COMPENSATE_TEXT,
88 HEADPHONE_COMPENSATE_LONGTEXT, VLC_TRUE );
89 add_bool( "headphone-dolby", 0, NULL, HEADPHONE_DOLBY_TEXT,
90 HEADPHONE_DOLBY_LONGTEXT, VLC_TRUE );
92 set_capability( "audio filter", 0 );
93 set_callbacks( Create, Destroy );
94 add_shortcut( "headphone" );
98 set_description( _("Headphone virtual spatialization effect") );
99 set_capability( "audio filter2", 0 );
100 set_callbacks( OpenFilter, CloseFilter );
104 /*****************************************************************************
105 * Internal data structures
106 *****************************************************************************/
107 struct atomic_operation_t
109 int i_source_channel_offset;
110 int i_dest_channel_offset;
111 unsigned int i_delay;/* in sample unit */
112 double d_amplitude_factor;
115 struct aout_filter_sys_t
117 size_t i_overflow_buffer_size;/* in bytes */
118 byte_t * p_overflow_buffer;
119 unsigned int i_nb_atomic_operations;
120 struct atomic_operation_t * p_atomic_operations;
125 size_t i_overflow_buffer_size;/* in bytes */
126 byte_t * p_overflow_buffer;
127 unsigned int i_nb_atomic_operations;
128 struct atomic_operation_t * p_atomic_operations;
131 /*****************************************************************************
132 * Init: initialize internal data structures
133 * and computes the needed atomic operations
134 *****************************************************************************/
135 /* x and z represent the coordinates of the virtual speaker
136 * relatively to the center of the listener's head, measured in meters :
145 * rear left rear right
149 static void ComputeChannelOperations( struct aout_filter_sys_t * p_data
150 , unsigned int i_rate, unsigned int i_next_atomic_operation
151 , int i_source_channel_offset, double d_x, double d_z
152 , double d_compensation_length, double d_channel_amplitude_factor )
154 double d_c = 340; /*sound celerity (unit: m/s)*/
155 double d_compensation_delay = (d_compensation_length-0.1) / d_c * i_rate;
158 p_data->p_atomic_operations[i_next_atomic_operation]
159 .i_source_channel_offset = i_source_channel_offset;
160 p_data->p_atomic_operations[i_next_atomic_operation]
161 .i_dest_channel_offset = 0;/* left */
162 p_data->p_atomic_operations[i_next_atomic_operation]
163 .i_delay = (int)( sqrt( (-0.1-d_x)*(-0.1-d_x) + (0-d_z)*(0-d_z) )
164 / d_c * i_rate - d_compensation_delay );
167 p_data->p_atomic_operations[i_next_atomic_operation]
168 .d_amplitude_factor = d_channel_amplitude_factor * 1.1 / 2;
172 p_data->p_atomic_operations[i_next_atomic_operation]
173 .d_amplitude_factor = d_channel_amplitude_factor * 0.9 / 2;
177 p_data->p_atomic_operations[i_next_atomic_operation]
178 .d_amplitude_factor = d_channel_amplitude_factor / 2;
182 p_data->p_atomic_operations[i_next_atomic_operation + 1]
183 .i_source_channel_offset = i_source_channel_offset;
184 p_data->p_atomic_operations[i_next_atomic_operation + 1]
185 .i_dest_channel_offset = 1;/* right */
186 p_data->p_atomic_operations[i_next_atomic_operation + 1]
187 .i_delay = (int)( sqrt( (0.1-d_x)*(0.1-d_x) + (0-d_z)*(0-d_z) )
188 / d_c * i_rate - d_compensation_delay );
191 p_data->p_atomic_operations[i_next_atomic_operation + 1]
192 .d_amplitude_factor = d_channel_amplitude_factor * 0.9 / 2;
196 p_data->p_atomic_operations[i_next_atomic_operation + 1]
197 .d_amplitude_factor = d_channel_amplitude_factor * 1.1 / 2;
201 p_data->p_atomic_operations[i_next_atomic_operation + 1]
202 .d_amplitude_factor = d_channel_amplitude_factor / 2;
206 static int Init( vlc_object_t *p_this, struct aout_filter_sys_t * p_data
207 , unsigned int i_nb_channels, uint32_t i_physical_channels
208 , unsigned int i_rate )
210 double d_x = config_GetInt( p_this, "headphone-dim" );
212 double d_z_rear = -d_x/3;
214 unsigned int i_next_atomic_operation;
215 int i_source_channel_offset;
220 msg_Dbg( p_this, "passing a null pointer as argument" );
224 if( config_GetInt( p_this, "headphone-compensate" ) )
226 /* minimal distance to any speaker */
227 if( i_physical_channels & AOUT_CHAN_REARCENTER )
237 /* Number of elementary operations */
238 p_data->i_nb_atomic_operations = i_nb_channels * 2;
239 if( i_physical_channels & AOUT_CHAN_CENTER )
241 p_data->i_nb_atomic_operations += 2;
243 p_data->p_atomic_operations = malloc( sizeof(struct atomic_operation_t)
244 * p_data->i_nb_atomic_operations );
245 if( p_data->p_atomic_operations == NULL )
247 msg_Err( p_this, "out of memory" );
251 /* For each virtual speaker, computes elementary wave propagation time
253 i_next_atomic_operation = 0;
254 i_source_channel_offset = 0;
255 if( i_physical_channels & AOUT_CHAN_LEFT )
257 ComputeChannelOperations( p_data , i_rate
258 , i_next_atomic_operation , i_source_channel_offset
259 , -d_x , d_z , d_min , 2.0 / i_nb_channels );
260 i_next_atomic_operation += 2;
261 i_source_channel_offset++;
263 if( i_physical_channels & AOUT_CHAN_RIGHT )
265 ComputeChannelOperations( p_data , i_rate
266 , i_next_atomic_operation , i_source_channel_offset
267 , d_x , d_z , d_min , 2.0 / i_nb_channels );
268 i_next_atomic_operation += 2;
269 i_source_channel_offset++;
271 if( i_physical_channels & AOUT_CHAN_MIDDLELEFT )
273 ComputeChannelOperations( p_data , i_rate
274 , i_next_atomic_operation , i_source_channel_offset
275 , -d_x , 0 , d_min , 1.5 / i_nb_channels );
276 i_next_atomic_operation += 2;
277 i_source_channel_offset++;
279 if( i_physical_channels & AOUT_CHAN_MIDDLERIGHT )
281 ComputeChannelOperations( p_data , i_rate
282 , i_next_atomic_operation , i_source_channel_offset
283 , d_x , 0 , d_min , 1.5 / i_nb_channels );
284 i_next_atomic_operation += 2;
285 i_source_channel_offset++;
287 if( i_physical_channels & AOUT_CHAN_REARLEFT )
289 ComputeChannelOperations( p_data , i_rate
290 , i_next_atomic_operation , i_source_channel_offset
291 , -d_x , d_z_rear , d_min , 1.5 / i_nb_channels );
292 i_next_atomic_operation += 2;
293 i_source_channel_offset++;
295 if( i_physical_channels & AOUT_CHAN_REARRIGHT )
297 ComputeChannelOperations( p_data , i_rate
298 , i_next_atomic_operation , i_source_channel_offset
299 , d_x , d_z_rear , d_min , 1.5 / i_nb_channels );
300 i_next_atomic_operation += 2;
301 i_source_channel_offset++;
303 if( i_physical_channels & AOUT_CHAN_REARCENTER )
305 ComputeChannelOperations( p_data , i_rate
306 , i_next_atomic_operation , i_source_channel_offset
307 , 0 , -d_z , d_min , 1.5 / i_nb_channels );
308 i_next_atomic_operation += 2;
309 i_source_channel_offset++;
311 if( i_physical_channels & AOUT_CHAN_CENTER )
313 /* having two center channels increases the spatialization effect */
314 ComputeChannelOperations( p_data , i_rate
315 , i_next_atomic_operation , i_source_channel_offset
316 , d_x / 5.0 , d_z , d_min , 0.75 / i_nb_channels );
317 i_next_atomic_operation += 2;
318 ComputeChannelOperations( p_data , i_rate
319 , i_next_atomic_operation , i_source_channel_offset
320 , -d_x / 5.0 , d_z , d_min , 0.75 / i_nb_channels );
321 i_next_atomic_operation += 2;
322 i_source_channel_offset++;
324 if( i_physical_channels & AOUT_CHAN_LFE )
326 ComputeChannelOperations( p_data , i_rate
327 , i_next_atomic_operation , i_source_channel_offset
328 , 0 , d_z_rear , d_min , 5.0 / i_nb_channels );
329 i_next_atomic_operation += 2;
330 i_source_channel_offset++;
333 /* Initialize the overflow buffer
334 * we need it because the process induce a delay in the samples */
335 p_data->i_overflow_buffer_size = 0;
336 for( i = 0 ; i < p_data->i_nb_atomic_operations ; i++ )
338 if( p_data->i_overflow_buffer_size
339 < p_data->p_atomic_operations[i].i_delay * 2 * sizeof (float) )
341 p_data->i_overflow_buffer_size
342 = p_data->p_atomic_operations[i].i_delay * 2 * sizeof (float);
345 p_data->p_overflow_buffer = malloc( p_data->i_overflow_buffer_size );
346 if( p_data->p_atomic_operations == NULL )
348 msg_Err( p_this, "out of memory" );
351 memset( p_data->p_overflow_buffer, 0 , p_data->i_overflow_buffer_size );
357 /*****************************************************************************
358 * Create: allocate headphone downmixer
359 *****************************************************************************/
360 static int Create( vlc_object_t *p_this )
362 aout_filter_t * p_filter = (aout_filter_t *)p_this;
363 vlc_bool_t b_fit = VLC_TRUE;
365 /* Activate this filter only with stereo devices */
366 if( p_filter->output.i_physical_channels
367 != (AOUT_CHAN_LEFT|AOUT_CHAN_RIGHT) )
369 msg_Dbg( p_filter, "filter discarded (incompatible format)" );
373 /* Request a specific format if not already compatible */
374 if( p_filter->input.i_original_channels
375 != p_filter->output.i_original_channels )
378 p_filter->input.i_original_channels =
379 p_filter->output.i_original_channels;
381 if( p_filter->input.i_format != VLC_FOURCC('f','l','3','2')
382 || p_filter->output.i_format != VLC_FOURCC('f','l','3','2') )
385 p_filter->input.i_format = VLC_FOURCC('f','l','3','2');
386 p_filter->output.i_format = VLC_FOURCC('f','l','3','2');
388 if( p_filter->input.i_rate != p_filter->output.i_rate )
391 p_filter->input.i_rate = p_filter->output.i_rate;
393 if( p_filter->input.i_physical_channels == (AOUT_CHAN_LEFT|AOUT_CHAN_RIGHT)
394 && ( p_filter->input.i_original_channels & AOUT_CHAN_DOLBYSTEREO )
395 && ! config_GetInt ( p_filter , "headphone-dolby" ) )
398 p_filter->input.i_physical_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT |
405 msg_Dbg( p_filter, "requesting specific format" );
409 /* Allocate the memory needed to store the module's structure */
410 p_filter->p_sys = malloc( sizeof(struct aout_filter_sys_t) );
411 if( p_filter->p_sys == NULL )
413 msg_Err( p_filter, "out of memory" );
416 p_filter->p_sys->i_overflow_buffer_size = 0;
417 p_filter->p_sys->p_overflow_buffer = NULL;
418 p_filter->p_sys->i_nb_atomic_operations = 0;
419 p_filter->p_sys->p_atomic_operations = NULL;
421 if( Init( VLC_OBJECT(p_filter), p_filter->p_sys
422 , aout_FormatNbChannels ( &p_filter->input )
423 , p_filter->input.i_physical_channels
424 , p_filter->input.i_rate ) < 0 )
429 p_filter->pf_do_work = DoWork;
430 p_filter->b_in_place = 0;
435 /*****************************************************************************
436 * Destroy: deallocate resources associated with headphone downmixer
437 *****************************************************************************/
438 static void Destroy( vlc_object_t *p_this )
440 aout_filter_t * p_filter = (aout_filter_t *)p_this;
442 if( p_filter->p_sys != NULL )
444 if( p_filter->p_sys->p_overflow_buffer != NULL )
446 free( p_filter->p_sys->p_overflow_buffer );
448 if( p_filter->p_sys->p_atomic_operations != NULL )
450 free( p_filter->p_sys->p_atomic_operations );
452 free( p_filter->p_sys );
453 p_filter->p_sys = NULL;
457 /*****************************************************************************
458 * DoWork: convert a buffer
459 *****************************************************************************/
460 static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
461 aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf )
463 int i_input_nb = aout_FormatNbChannels( &p_filter->input );
464 int i_output_nb = aout_FormatNbChannels( &p_filter->output );
466 float * p_in = (float*) p_in_buf->p_buffer;
471 size_t i_overflow_size; /* in bytes */
472 size_t i_out_size; /* in bytes */
476 int i_source_channel_offset;
477 int i_dest_channel_offset;
478 unsigned int i_delay;
479 double d_amplitude_factor;
481 /* out buffer characterisitcs */
482 p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
483 p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes * i_output_nb / i_input_nb;
484 p_out = p_out_buf->p_buffer;
485 i_out_size = p_out_buf->i_nb_bytes;
487 if( p_filter->p_sys != NULL )
489 /* Slide the overflow buffer */
490 p_overflow = p_filter->p_sys->p_overflow_buffer;
491 i_overflow_size = p_filter->p_sys->i_overflow_buffer_size;
493 memset( p_out, 0, i_out_size );
494 if ( i_out_size > i_overflow_size )
495 memcpy( p_out, p_overflow, i_overflow_size );
497 memcpy( p_out, p_overflow, i_out_size );
499 p_slide = p_filter->p_sys->p_overflow_buffer;
500 while( p_slide < p_overflow + i_overflow_size )
502 if( p_slide + i_out_size < p_overflow + i_overflow_size )
504 memset( p_slide, 0, i_out_size );
505 if( p_slide + 2 * i_out_size < p_overflow + i_overflow_size )
506 memcpy( p_slide, p_slide + i_out_size, i_out_size );
508 memcpy( p_slide, p_slide + i_out_size,
509 p_overflow + i_overflow_size - ( p_slide + i_out_size ) );
513 memset( p_slide, 0, p_overflow + i_overflow_size - p_slide );
515 p_slide += i_out_size;
518 /* apply the atomic operations */
519 for( i = 0; i < p_filter->p_sys->i_nb_atomic_operations; i++ )
521 /* shorter variable names */
522 i_source_channel_offset
523 = p_filter->p_sys->p_atomic_operations[i].i_source_channel_offset;
524 i_dest_channel_offset
525 = p_filter->p_sys->p_atomic_operations[i].i_dest_channel_offset;
526 i_delay = p_filter->p_sys->p_atomic_operations[i].i_delay;
528 = p_filter->p_sys->p_atomic_operations[i].d_amplitude_factor;
530 if( p_out_buf->i_nb_samples > i_delay )
532 /* current buffer coefficients */
533 for( j = 0; j < p_out_buf->i_nb_samples - i_delay; j++ )
535 ((float*)p_out)[ (i_delay+j)*i_output_nb + i_dest_channel_offset ]
536 += p_in[ j * i_input_nb + i_source_channel_offset ]
537 * d_amplitude_factor;
540 /* overflow buffer coefficients */
541 for( j = 0; j < i_delay; j++ )
543 ((float*)p_overflow)[ j*i_output_nb + i_dest_channel_offset ]
544 += p_in[ (p_out_buf->i_nb_samples - i_delay + j)
545 * i_input_nb + i_source_channel_offset ]
546 * d_amplitude_factor;
551 /* overflow buffer coefficients only */
552 for( j = 0; j < p_out_buf->i_nb_samples; j++ )
554 ((float*)p_overflow)[ (i_delay - p_out_buf->i_nb_samples + j)
555 * i_output_nb + i_dest_channel_offset ]
556 += p_in[ j * i_input_nb + i_source_channel_offset ]
557 * d_amplitude_factor;
564 memset( p_out, 0, i_out_size );
571 /*****************************************************************************
573 *****************************************************************************/
574 static int OpenFilter( vlc_object_t *p_this )
576 filter_t *p_filter = (filter_t *)p_this;
577 vlc_bool_t b_fit = VLC_TRUE;
579 /* Activate this filter only with stereo devices */
580 if( p_filter->fmt_out.audio.i_physical_channels
581 != (AOUT_CHAN_LEFT|AOUT_CHAN_RIGHT) )
583 msg_Dbg( p_filter, "filter discarded (incompatible format)" );
587 /* Request a specific format if not already compatible */
588 if( p_filter->fmt_in.audio.i_original_channels
589 != p_filter->fmt_out.audio.i_original_channels )
592 p_filter->fmt_in.audio.i_original_channels =
593 p_filter->fmt_out.audio.i_original_channels;
595 if( p_filter->fmt_in.audio.i_format != VLC_FOURCC('f','l','3','2')
596 || p_filter->fmt_out.audio.i_format != VLC_FOURCC('f','l','3','2') )
599 p_filter->fmt_in.audio.i_format = VLC_FOURCC('f','l','3','2');
600 p_filter->fmt_out.audio.i_format = VLC_FOURCC('f','l','3','2');
602 if( p_filter->fmt_in.audio.i_rate != p_filter->fmt_out.audio.i_rate )
605 p_filter->fmt_in.audio.i_rate = p_filter->fmt_out.audio.i_rate;
607 if( p_filter->fmt_in.audio.i_physical_channels == (AOUT_CHAN_LEFT|AOUT_CHAN_RIGHT)
608 && ( p_filter->fmt_in.audio.i_original_channels & AOUT_CHAN_DOLBYSTEREO )
609 && !config_GetInt( p_filter, "headphone-dolby" ) )
612 p_filter->fmt_in.audio.i_physical_channels = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT |
619 msg_Dbg( p_filter, "requesting specific format" );
623 /* Allocate the memory needed to store the module's structure */
624 p_filter->p_sys = malloc( sizeof(struct filter_sys_t) );
625 if( p_filter->p_sys == NULL )
627 msg_Err( p_filter, "out of memory" );
630 p_filter->p_sys->i_overflow_buffer_size = 0;
631 p_filter->p_sys->p_overflow_buffer = NULL;
632 p_filter->p_sys->i_nb_atomic_operations = 0;
633 p_filter->p_sys->p_atomic_operations = NULL;
635 if( Init( VLC_OBJECT(p_filter), (struct aout_filter_sys_t *)p_filter->p_sys
636 , aout_FormatNbChannels ( &(p_filter->fmt_in.audio) )
637 , p_filter->fmt_in.audio.i_physical_channels
638 , p_filter->fmt_in.audio.i_rate ) < 0 )
643 p_filter->pf_audio_filter = Convert;
644 p_filter->fmt_out.audio.i_rate = p_filter->fmt_in.audio.i_rate;
649 /*****************************************************************************
650 * CloseFilter : deallocate data structures
651 *****************************************************************************/
652 static void CloseFilter( vlc_object_t *p_this )
654 filter_t *p_filter = (filter_t *)p_this;
656 if( p_filter->p_sys != NULL )
658 if( p_filter->p_sys->p_overflow_buffer != NULL )
660 free ( p_filter->p_sys->p_overflow_buffer );
662 if( p_filter->p_sys->p_atomic_operations != NULL )
664 free ( p_filter->p_sys->p_atomic_operations );
666 free( p_filter->p_sys );
667 p_filter->p_sys = NULL;
671 static block_t *Convert( filter_t *p_filter, block_t *p_block )
673 aout_filter_t aout_filter;
674 aout_buffer_t in_buf, out_buf;
678 if( !p_block || !p_block->i_samples )
680 if( p_block ) p_block->pf_release( p_block );
684 i_out_size = p_block->i_samples *
685 p_filter->fmt_out.audio.i_bitspersample/8 *
686 aout_FormatNbChannels( &(p_filter->fmt_out.audio) );
688 p_out = p_filter->pf_audio_buffer_new( p_filter, i_out_size );
691 msg_Warn( p_filter, "can't get output buffer" );
692 if( p_block ) p_block->pf_release( p_block );
696 p_out->i_samples = p_block->i_samples;
697 p_out->i_dts = p_block->i_dts;
698 p_out->i_pts = p_block->i_pts;
699 p_out->i_length = p_block->i_length;
701 aout_filter.p_sys = (struct aout_filter_sys_t *)p_filter->p_sys;
702 aout_filter.input = p_filter->fmt_in.audio;
703 aout_filter.input.i_format = p_filter->fmt_in.i_codec;
704 aout_filter.output = p_filter->fmt_out.audio;
705 aout_filter.output.i_format = p_filter->fmt_out.i_codec;
706 aout_filter.b_in_place = 0;
708 in_buf.p_buffer = p_block->p_buffer;
709 in_buf.i_nb_bytes = p_block->i_buffer;
710 in_buf.i_nb_samples = p_block->i_samples;
711 out_buf.p_buffer = p_out->p_buffer;
712 out_buf.i_nb_bytes = p_out->i_buffer;
713 out_buf.i_nb_samples = p_out->i_samples;
715 DoWork( (aout_instance_t *)p_filter, &aout_filter, &in_buf, &out_buf );
717 p_out->i_buffer = out_buf.i_nb_bytes;
718 p_out->i_samples = out_buf.i_nb_samples;
720 if( p_block ) p_block->pf_release( p_block );