1 /*****************************************************************************
2 * aout.c : dummy audio output plugin
3 *****************************************************************************
4 * Copyright (C) 2002 the VideoLAN team
7 * Authors: Christophe Massiot <massiot@via.ecp.fr>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 /*****************************************************************************
26 *****************************************************************************/
32 #include <vlc_common.h>
37 #define FRAME_SIZE 2048
38 #define A52_FRAME_NB 1536
40 /*****************************************************************************
42 *****************************************************************************/
43 static void Play ( aout_instance_t * );
45 /*****************************************************************************
46 * OpenAudio: open a dummy audio device
47 *****************************************************************************/
48 int OpenAudio ( vlc_object_t * p_this )
50 aout_instance_t * p_aout = (aout_instance_t *)p_this;
52 p_aout->output.pf_play = Play;
53 aout_VolumeSoftInit( p_aout );
55 if ( p_aout->output.output.i_format == VLC_CODEC_SPDIFL )
57 p_aout->output.i_nb_samples = A52_FRAME_NB;
58 p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE;
59 p_aout->output.output.i_frame_length = A52_FRAME_NB;
63 p_aout->output.i_nb_samples = FRAME_SIZE;
66 /* Create the variable for the audio-device */
67 var_Create( p_aout, "audio-device", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
72 /*****************************************************************************
73 * Play: pretend to play a sound
74 *****************************************************************************/
75 static void Play( aout_instance_t * p_aout )
77 aout_buffer_t * p_buffer = aout_FifoPop( p_aout, &p_aout->output.fifo );
78 aout_BufferFree( p_buffer );