1 /*****************************************************************************
2 * adummy.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>
33 #include <vlc_plugin.h>
37 static int Open( vlc_object_t * p_this );
40 set_shortname( N_("Dummy") )
41 set_description( N_("Dummy audio output") )
42 set_capability( "audio output", 0 )
43 set_callbacks( Open, NULL )
44 add_shortcut( "dummy" )
47 #define A52_FRAME_NB 1536
49 /*****************************************************************************
51 *****************************************************************************/
52 static void Play( audio_output_t *, block_t * );
54 /*****************************************************************************
55 * OpenAudio: open a dummy audio device
56 *****************************************************************************/
57 static int Open( vlc_object_t * p_this )
59 audio_output_t * p_aout = (audio_output_t *)p_this;
61 p_aout->pf_play = Play;
62 p_aout->pf_pause = NULL;
63 p_aout->pf_flush = NULL;
64 aout_VolumeSoftInit( p_aout );
66 if( AOUT_FMT_SPDIF( &p_aout->format )
67 && var_InheritBool( p_this, "spdif" ) )
69 p_aout->format.i_format = VLC_CODEC_SPDIFL;
70 p_aout->format.i_bytes_per_frame = AOUT_SPDIF_SIZE;
71 p_aout->format.i_frame_length = A52_FRAME_NB;
74 p_aout->format.i_format = HAVE_FPU ? VLC_CODEC_FL32 : VLC_CODEC_S16N;
76 /* Create the variable for the audio-device */
77 var_Create( p_aout, "audio-device", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE );
82 /*****************************************************************************
83 * Play: pretend to play a sound
84 *****************************************************************************/
85 static void Play( audio_output_t *aout, block_t *block )
87 block_Release( block );