]> git.sesse.net Git - vlc/commitdiff
. ajout de l'audio output pour Esound
authorSam Hocevar <sam@videolan.org>
Mon, 21 Feb 2000 04:21:52 +0000 (04:21 +0000)
committerSam Hocevar <sam@videolan.org>
Mon, 21 Feb 2000 04:21:52 +0000 (04:21 +0000)
 . pas encore tr�s au point � cause d'un bug dans esd_get_latency() mais
 j'en ai besoin pour tester le chargement dynamique de plugins.

Makefile
include/audio_output.h
src/audio_output/audio_output.c
src/audio_output/audio_sys.h
src/interface/main.c

index 93a817294ed98d7d72b4870c5cd5e984d0fc9499..a41d2b9dff5419e82a8c2795ab03ef8a1ea19276 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,7 @@ SHELL=/bin/sh
 # Audio output settings
 AUDIO = dsp
 # Not yet supported
-#AUDIO += esd
+AUDIO += esd
 # Fallback method that should always work
 AUDIO += dummy
 
@@ -118,9 +118,7 @@ LIB += -lpthread
 LIB += -lm
 
 ifneq (,$(findstring x11,$(video)))
-LIB += -L/usr/X11R6/lib
-LIB += -lX11
-LIB += -lXext 
+LIB += -L/usr/X11R6/lib -lX11 -lXext 
 endif
 ifneq (,$(findstring ggi,$(video)))
 LIB += -lggi
@@ -129,6 +127,10 @@ ifneq (,$(findstring glide,$(video)))
 LIB += -lglide2x
 endif
 
+ifneq (,$(findstring esd,$(audio)))
+LIB += -lesd -laudiofile
+endif
+
 #
 # C compiler flags: compilation
 #
index 3fb36a62f82ee70f62be50c5ea269a4477c9abbd..849d1b429181dffed5f0a58510d26969ab53f77b 100644 (file)
@@ -216,8 +216,12 @@ typedef struct aout_thread_s
 #ifdef AUDIO_DSP
 #define AOUT_DEFAULT_METHOD "dsp"
 #else
+#ifdef AUDIO_ESD
+#define AOUT_DEFAULT_METHOD "esd"
+#else
 #define AOUT_DEFAULT_METHOD "dummy"
 #endif
+#endif
 
 /* Those are from <linux/soundcard.h> but are needed because of formats
  * on other platforms */
index 4e69c8c63f31d6fa11886f91a7d48a18a2c23ad9..921a31a1aaec54319a26446ac201c16ecf97c410 100644 (file)
@@ -97,6 +97,19 @@ aout_thread_t *aout_CreateThread( int *pi_status )
         p_aout->p_sys_playsamples =    aout_DspSysPlaySamples;
         p_aout->p_sys_close =          aout_DspSysClose;
     }
+#endif
+#ifdef AUDIO_ESD
+    else if( !strcmp(psz_method, "esd") )
+    {
+        p_aout->p_sys_open =           aout_EsdSysOpen;
+        p_aout->p_sys_reset =          aout_EsdSysReset;
+        p_aout->p_sys_setformat =      aout_EsdSysSetFormat;
+        p_aout->p_sys_setchannels =    aout_EsdSysSetChannels;
+        p_aout->p_sys_setrate =        aout_EsdSysSetRate;
+        p_aout->p_sys_getbufinfo =     aout_EsdSysGetBufInfo;
+        p_aout->p_sys_playsamples =    aout_EsdSysPlaySamples;
+        p_aout->p_sys_close =          aout_EsdSysClose;
+    }
 #endif
     else
     {
@@ -277,7 +290,7 @@ static int aout_SpawnThread( aout_thread_t * p_aout )
 
     /* Before launching the thread, we try to predict the date of the first
      * audio unit in the first output buffer */
-    p_aout->date = mdate();
+    p_aout->date = mdate() - 1000000;
 
     /* Launch the thread */
     if ( vlc_thread_create( &p_aout->thread_id, "audio output", (vlc_thread_func_t)aout_thread, p_aout ) )
@@ -1094,7 +1107,7 @@ void aout_Thread_S16_Stereo( aout_thread_t * p_aout )
         }
 
         l_bytes = p_aout->p_sys_getbufinfo( p_aout, l_buffer_limit );
-        p_aout->date = mdate() + ((((mtime_t)(l_bytes / 4)) * 1000000) / ((mtime_t)p_aout->l_rate)); /* sizeof(s16) << (p_aout->b_stereo) == 4 */
+        p_aout->date = -1000000 + mdate() + ((((mtime_t)(l_bytes / 4)) * 1000000) / ((mtime_t)p_aout->l_rate)); /* sizeof(s16) << (p_aout->b_stereo) == 4 */
         p_aout->p_sys_playsamples( p_aout, (byte_t *)p_aout->buffer, l_buffer_limit * sizeof(s16) );
         if ( l_bytes > (l_buffer_limit * sizeof(s16)) )
         {
index 329d2e66e7aad394c9714b5d24d19b4dc98973a1..79ed6e306018f42098c9e4cf2282830ad32388dc 100644 (file)
@@ -30,3 +30,13 @@ long aout_DspSysGetBufInfo      ( aout_thread_t *p_aout, long l_buffer_info );
 void aout_DspSysPlaySamples     ( aout_thread_t *p_aout, byte_t *buffer, int i_size );
 void aout_DspSysClose           ( aout_thread_t *p_aout );
 #endif
+#ifdef AUDIO_ESD
+int  aout_EsdSysOpen            ( aout_thread_t *p_aout );
+int  aout_EsdSysReset           ( aout_thread_t *p_aout );
+int  aout_EsdSysSetFormat       ( aout_thread_t *p_aout );
+int  aout_EsdSysSetChannels     ( aout_thread_t *p_aout );
+int  aout_EsdSysSetRate         ( aout_thread_t *p_aout );
+long aout_EsdSysGetBufInfo      ( aout_thread_t *p_aout, long l_buffer_info );
+void aout_EsdSysPlaySamples     ( aout_thread_t *p_aout, byte_t *buffer, int i_size );
+void aout_EsdSysClose           ( aout_thread_t *p_aout );
+#endif
index a9f67cb6304ffe49f22d5ea48afcb8e08527605e..17eea22da929c1fb16e25c501d245a5d0a4ffb56 100644 (file)
@@ -16,8 +16,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <sys/soundcard.h>                                 /* audio_output.h */
-
 #include "config.h"
 #include "common.h"
 #include "mtime.h"