Commit f8371eed authored by Sam Hocevar's avatar Sam Hocevar

. ajout de l'audio output pour Esound

 . 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.
parent ae697f31
......@@ -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
#
......
......@@ -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 */
......
......@@ -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)) )
{
......
......@@ -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
......@@ -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"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment