]> git.sesse.net Git - vlc/blobdiff - modules/misc/dummy/aout.c
Removes trailing spaces. Removes tabs.
[vlc] / modules / misc / dummy / aout.c
index 3c40338d78c00146f9ded060551b03b798b103a7..756cafa35c27eaaebc259f48fdce711ad6971a1c 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * aout_dummy.c : dummy audio output plugin
  *****************************************************************************
- * Copyright (C) 2002 VideoLAN
- * $Id: aout.c,v 1.4 2002/08/14 00:23:59 massiot Exp $
+ * Copyright (C) 2002 the VideoLAN team
+ * $Id$
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -10,7 +10,7 @@
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <string.h>
-#include <stdlib.h>
 
 #include <vlc/vlc.h>
-#include <vlc/aout.h>
+#include <vlc_aout.h>
 
-#include "aout_internal.h"
+#include "dummy.h"
 
 #define FRAME_SIZE 2048
 #define A52_FRAME_NB 1536
@@ -38,8 +36,7 @@
 /*****************************************************************************
  * Local prototypes.
  *****************************************************************************/
-static int     SetFormat   ( aout_instance_t * );
-static void    Play        ( aout_instance_t *, aout_buffer_t * );
+static void    Play        ( aout_instance_t * );
 
 /*****************************************************************************
  * OpenAudio: open a dummy audio device
@@ -48,22 +45,14 @@ int E_(OpenAudio) ( vlc_object_t * p_this )
 {
     aout_instance_t * p_aout = (aout_instance_t *)p_this;
 
-    p_aout->output.pf_setformat = SetFormat;
     p_aout->output.pf_play = Play;
+    aout_VolumeSoftInit( p_aout );
 
-    return VLC_SUCCESS;
-}
-
-/*****************************************************************************
- * SetFormat: pretend to set the dsp output format
- *****************************************************************************/
-static int SetFormat( aout_instance_t * p_aout )
-{
-    if ( p_aout->output.output.i_format == AOUT_FMT_SPDIF )
+    if ( p_aout->output.output.i_format == VLC_FOURCC('s','p','d','i') )
     {
         p_aout->output.i_nb_samples = A52_FRAME_NB;
-        p_aout->output.output.i_bytes_per_sec = p_aout->output.output.i_rate
-                                     * AOUT_SPDIF_SIZE / A52_FRAME_NB;
+        p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE;
+        p_aout->output.output.i_frame_length = A52_FRAME_NB;
     }
     else
     {
@@ -75,8 +64,9 @@ static int SetFormat( aout_instance_t * p_aout )
 /*****************************************************************************
  * Play: pretend to play a sound
  *****************************************************************************/
-static void Play( aout_instance_t * p_aout, aout_buffer_t * p_buffer )
+static void Play( aout_instance_t * p_aout )
 {
+    aout_buffer_t * p_buffer = aout_FifoPop( p_aout, &p_aout->output.fifo );
     aout_BufferFree( p_buffer );
 }