]> git.sesse.net Git - vlc/blobdiff - modules/misc/dummy/aout.c
Audio output 3. Expect major breakages.
[vlc] / modules / misc / dummy / aout.c
index 20c45aa9d4845bdf96f47b784a7fbdbaf920b12b..abbfa7c26247378d8dd019f4d7ee0856ad73a8e6 100644 (file)
@@ -1,10 +1,10 @@
 /*****************************************************************************
  * aout_dummy.c : dummy audio output plugin
  *****************************************************************************
- * Copyright (C) 2000, 2001 VideoLAN
- * $Id: aout.c,v 1.1 2002/08/04 17:23:43 sam Exp $
+ * Copyright (C) 2002 VideoLAN
+ * $Id: aout.c,v 1.2 2002/08/07 21:36:56 massiot Exp $
  *
- * Authors: Samuel Hocevar <sam@zoy.org>
+ * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * Preamble
  *****************************************************************************/
 #include <string.h>
+#include <stdlib.h>
 
 #include <vlc/vlc.h>
 #include <vlc/aout.h>
 
+#include "aout_internal.h"
+
 /*****************************************************************************
  * Local prototypes.
  *****************************************************************************/
-static int     SetFormat   ( aout_thread_t * );
-static int     GetBufInfo  ( aout_thread_t *, int );
-static void    Play        ( aout_thread_t *, byte_t *, int );
+static int     SetFormat   ( aout_instance_t * );
+static void    Play        ( aout_instance_t *, aout_buffer_t * );
 
 /*****************************************************************************
- * OpenAudio: opens a dummy audio device
+ * OpenAudio: open a dummy audio device
  *****************************************************************************/
-int E_(OpenAudio) ( vlc_object_t *p_this )
+int E_(OpenAudio) ( vlc_object_t * p_this )
 {
-    aout_thread_t * p_aout = (aout_thread_t *)p_this;
+    aout_instance_t * p_aout = (aout_instance_t *)p_this;
 
-    p_aout->pf_setformat = SetFormat;
-    p_aout->pf_getbufinfo = GetBufInfo;
-    p_aout->pf_play = Play;
+    p_aout->output.pf_setformat = SetFormat;
+    p_aout->output.pf_play = Play;
 
     return VLC_SUCCESS;
 }
 
 /*****************************************************************************
- * SetFormat: pretends to set the dsp output format
- *****************************************************************************/
-static int SetFormat( aout_thread_t *p_aout )
-{
-    return( 0 );
-}
-
-/*****************************************************************************
- * GetBufInfo: returns available bytes in buffer
+ * SetFormat: pretend to set the dsp output format
  *****************************************************************************/
-static int GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
+static int SetFormat( aout_instance_t * p_aout )
 {
-    return( sizeof(s16) * i_buffer_limit + 1 ); /* value big enough to sleep */
+    p_aout->output.i_nb_samples = 2048;
+    return 0;
 }
 
 /*****************************************************************************
- * Play: pretends to play a sound
+ * Play: pretend to play a sound
  *****************************************************************************/
-static void Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
+static void Play( aout_instance_t * p_aout, aout_buffer_t * p_buffer )
 {
-    ;
+    aout_BufferFree( p_buffer );
 }