]> git.sesse.net Git - vlc/blobdiff - modules/misc/dummy/aout.c
* ALL: More hooks for audio volume management.
[vlc] / modules / misc / dummy / aout.c
index 09b67bf073d578ce4e2427b1b14603b0067a129c..87b1025e941601f09658c1af2795066308494b82 100644 (file)
@@ -2,7 +2,7 @@
  * aout_dummy.c : dummy audio output plugin
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: aout.c,v 1.3 2002/08/12 22:12:51 massiot Exp $
+ * $Id: aout.c,v 1.9 2002/09/18 21:21:24 massiot Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
 #include "aout_internal.h"
 
 #define FRAME_SIZE 2048
+#define A52_FRAME_NB 1536
 
 /*****************************************************************************
  * 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
@@ -47,26 +47,28 @@ 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 )
-{
-    p_aout->output.i_nb_samples = FRAME_SIZE;
+    if ( p_aout->output.output.i_format == AOUT_FMT_SPDIF )
+    {
+        p_aout->output.i_nb_samples = 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
+    {
+        p_aout->output.i_nb_samples = FRAME_SIZE;
+    }
     return 0;
 }
 
 /*****************************************************************************
  * 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 );
 }