]> git.sesse.net Git - vlc/blobdiff - plugins/beos/aout_beos.cpp
* ./plugins/gtk/gnome_callbacks.c: fixed a crash when activating preferences
[vlc] / plugins / beos / aout_beos.cpp
index 5643d0f7330609e3929f0fe0a4cabc4116d53663..29d71565959b51094926fde53ac489a944670d7e 100644 (file)
@@ -2,7 +2,7 @@
  * aout_beos.cpp: BeOS audio output
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: aout_beos.cpp,v 1.17 2001/12/07 18:33:07 sam Exp $
+ * $Id: aout_beos.cpp,v 1.23 2002/02/24 22:06:50 sam Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  *****************************************************************************/
 
-#define MODULE_NAME beos
-#include "modules_inner.h"
-
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include "defs.h"
-
 #include <stdio.h>
 #include <stdlib.h>                                      /* malloc(), free() */
 #include <kernel/OS.h>
 
 extern "C"
 {
-#include "common.h"
-#include "intf_msg.h"
-#include "threads.h"
-#include "mtime.h"
+#include <videolan/vlc.h>
 
 #include "audio_output.h"
-
-#include "modules.h"
-#include "modules_export.h"
 }
 
 /*****************************************************************************
@@ -66,8 +55,8 @@ typedef struct aout_sys_s
     BPushGameSound * p_sound;
     gs_audio_format * p_format;
     void * p_buffer;
-    long i_buffer_size;
-    long i_buffer_pos;
+    int i_buffer_size;
+    int i_buffer_pos;
 
 } aout_sys_t;
 
@@ -77,10 +66,9 @@ extern "C"
 /*****************************************************************************
  * Local prototypes.
  *****************************************************************************/
-static int     aout_Probe       ( probedata_t *p_data );
 static int     aout_Open        ( aout_thread_t *p_aout );
 static int     aout_SetFormat   ( aout_thread_t *p_aout );
-static long    aout_GetBufInfo  ( aout_thread_t *p_aout, long l_buffer_info );
+static int     aout_GetBufInfo  ( aout_thread_t *p_aout, int i_buffer_info );
 static void    aout_Play        ( aout_thread_t *p_aout,
                                   byte_t *buffer, int i_size );
 static void    aout_Close       ( aout_thread_t *p_aout );
@@ -91,7 +79,6 @@ static void    aout_Close       ( aout_thread_t *p_aout );
  *****************************************************************************/
 void _M( aout_getfunctions )( function_list_t * p_function_list )
 {
-    p_function_list->pf_probe = aout_Probe;
     p_function_list->functions.aout.pf_open = aout_Open;
     p_function_list->functions.aout.pf_setformat = aout_SetFormat;
     p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
@@ -99,16 +86,6 @@ void _M( aout_getfunctions )( function_list_t * p_function_list )
     p_function_list->functions.aout.pf_close = aout_Close;
 }
 
-/*****************************************************************************
- * aout_Probe: probe the audio device and return a score
- *****************************************************************************/
-static int aout_Probe( probedata_t *p_data )
-{
-    /* We don't test anything since I don't know what to test. However
-     * if the module could be loaded it is quite likely to work. */
-    return( 100 );
-}
-
 /*****************************************************************************
  * aout_Open: opens a BPushGameSound
  *****************************************************************************/
@@ -132,11 +109,6 @@ static int aout_Open( aout_thread_t *p_aout )
     }
 
     /* Initialize some variables */
-    p_aout->i_format = AOUT_FORMAT_DEFAULT;
-    p_aout->i_channels = 1 + main_GetIntVariable( AOUT_STEREO_VAR,
-                                                  AOUT_STEREO_DEFAULT );
-    p_aout->l_rate = main_GetIntVariable( AOUT_RATE_VAR, AOUT_RATE_DEFAULT );
-
     p_aout->p_sys->p_format->frame_rate = 44100.0;
     p_aout->p_sys->p_format->channel_count = p_aout->i_channels;
     p_aout->p_sys->p_format->format = gs_audio_format::B_GS_S16;
@@ -177,18 +149,16 @@ static int aout_Open( aout_thread_t *p_aout )
  *****************************************************************************/
 static int aout_SetFormat( aout_thread_t *p_aout )
 {
-    p_aout->i_latency = 0;
-
     return( 0 );
 }
 
 /*****************************************************************************
  * aout_GetBufInfo: buffer status query
  *****************************************************************************/
-static long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
+static int aout_GetBufInfo( aout_thread_t *p_aout, int i_buffer_limit )
 {
     /* Each value is 4 bytes long (stereo signed 16 bits) */
-    long i_hard_pos = 4 * p_aout->p_sys->p_sound->CurrentPosition();
+    int i_hard_pos = 4 * p_aout->p_sys->p_sound->CurrentPosition();
 
     i_hard_pos = p_aout->p_sys->i_buffer_pos - i_hard_pos;
     if( i_hard_pos < 0 )
@@ -206,7 +176,7 @@ static long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
  *****************************************************************************/
 static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
 {
-    long i_newbuf_pos;
+    int i_newbuf_pos;
 
     if( (i_newbuf_pos = p_aout->p_sys->i_buffer_pos + i_size)
               > p_aout->p_sys->i_buffer_size )