Commit 6aaf8121 authored by Sam Hocevar's avatar Sam Hocevar

o remise de b_stereo dans les structures audio en attendant que soit

  d�finie une api pour la gestion de plus de 2 voies, qui de toute fa�on
  est loin d'�tre une priorit�. je dirais m�me qu'on s'en fout.
 o argument suppl�mentaire pour GetBufInfo() pour que la m�thode dummy
  attende un temps convenable, et correction de aout_dummy.c
 o le test sur la variable DEBUG dans config.h est maintenant conforme
  � ce que dit le Makefile.
 o suppression d'une variable inutile dans intf_fb.c
 o --long-help devient --longhelp comme dans mpg123
 o version du programme arbitrairement mise � 0.95.0
 o commentaire d'une variable inutilis�e dans Synchronize (video_output.c)
 o correction du "LIN" en "LIB" dans le Makefile, qui doit tra�ner l�
  depuis des si�cles
 o proprification de quelques routines du Makefile

le code de s�lection de m�thode audio/video est loin d'�tre propre, je
dirais m�me que c'est du gros caca, mais j'y bosse.

bonne nuit,
parent 62ee3e00
...@@ -14,17 +14,21 @@ ...@@ -14,17 +14,21 @@
#SHELL=/bin/sh #SHELL=/bin/sh
# Audio output settings # Audio output settings
AUDIO_DSP=YES AUDIO = dsp
# Not yet supported
#AUDIO += esd
# Fallback method that should always work
AUDIO += dummy
# Video output settings # Video output settings
VIDEO_X11=YES VIDEO = x11 fb
VIDEO_FB=YES #VIDEO += ggi
#VIDEO_GGI=YES #VIDEO += glide
# You probably won't need this one
#VIDEO_GLIDE=YES
# Not yet supported # Not yet supported
#VIDEO_BEOS=YES #VIDEO += beos
#VIDEO_DGA=YES #VIDEO += dga
# Fallback method that should always work
VIDEO += dummy
# Target architecture # Target architecture
ARCH=X86 ARCH=X86
...@@ -45,7 +49,7 @@ MMX=YES ...@@ -45,7 +49,7 @@ MMX=YES
DECODER=new DECODER=new
# Debugging mode on or off (set to 1 to activate) # Debugging mode on or off (set to 1 to activate)
DEBUG=1 DEBUG=0
#----------------- do not change anything below this line ---------------------- #----------------- do not change anything below this line ----------------------
...@@ -54,57 +58,17 @@ DEBUG=1 ...@@ -54,57 +58,17 @@ DEBUG=1
################################################################################ ################################################################################
# Program version - may only be changed by the project leader # Program version - may only be changed by the project leader
PROGRAM_VERSION = 1.0-dev PROGRAM_VERSION = 0.95.0
# AUDIO_OPTIONS describes all used audio options
AUDIO_OPTIONS = dummy
aout_method = audio_output/aout_dummy.o
ifeq ($(AUDIO_DSP), YES)
AUDIO_OPTIONS += dsp
DEFINE += -DAUDIO_DSP
aout_method += audio_output/aout_dsp.o
endif
# VIDEO_OPTIONS describes all used video options # audio options
VIDEO_OPTIONS = dummy audio := $(shell echo $(AUDIO) | tr 'A-Z' 'a-z')
intf_method = interface/intf_dummy.o AUDIO := $(shell echo $(AUDIO) | tr 'a-z' 'A-Z')
vout_method = video_output/vout_dummy.o DEFINE += $(AUDIO:%=-DAUDIO_%)
ifeq ($(VIDEO_GLIDE), YES)
VIDEO_OPTIONS += glide # video options
DEFINE += -DVIDEO_GLIDE video := $(shell echo $(VIDEO) | tr 'A-Z' 'a-z')
intf_method += interface/intf_glide.o VIDEO := $(shell echo $(VIDEO) | tr 'a-z' 'A-Z')
vout_method += video_output/vout_glide.o DEFINE += $(VIDEO:%=-DVIDEO_%)
endif
ifeq ($(VIDEO_X11), YES)
VIDEO_OPTIONS += x11
DEFINE += -DVIDEO_X11
intf_method += interface/intf_x11.o
vout_method += video_output/vout_x11.o
endif
ifeq ($(VIDEO_GGI), YES)
VIDEO_OPTIONS += ggi
DEFINE += -DVIDEO_GGI
intf_method += interface/intf_ggi.o
vout_method += video_output/vout_ggi.o
endif
ifeq ($(VIDEO_FB), YES)
VIDEO_OPTIONS += fb
DEFINE += -DVIDEO_FB
intf_method += interface/intf_fb.o
vout_method += video_output/vout_fb.o
endif
ifeq ($(VIDEO_BEOS), YES)
VIDEO_OPTIONS += beos
DEFINE += -DVIDEO_BEOS
intf_method += interface/intf_beos.o
vout_method += video_output/vout_beos.o
endif
ifeq ($(VIDEO_DGA), YES)
VIDEO_OPTIONS += dga
DEFINE += -DVIDEO_DGA
intf_method += interface/intf_dga.o
vout_method += video_output/vout_dga.o
endif
# PROGRAM_OPTIONS is an identification string of the compilation options # PROGRAM_OPTIONS is an identification string of the compilation options
PROGRAM_OPTIONS = $(ARCH) $(SYS) PROGRAM_OPTIONS = $(ARCH) $(SYS)
...@@ -119,8 +83,8 @@ PROGRAM_BUILD = `date -R` $(USER)@`hostname` ...@@ -119,8 +83,8 @@ PROGRAM_BUILD = `date -R` $(USER)@`hostname`
# including ARCH_xx and SYS_xx. It will be passed to C compiler. # including ARCH_xx and SYS_xx. It will be passed to C compiler.
DEFINE += -DARCH_$(ARCH) DEFINE += -DARCH_$(ARCH)
DEFINE += -DSYS_$(SYS) DEFINE += -DSYS_$(SYS)
DEFINE += -DAUDIO_OPTIONS="\"$(shell echo $(AUDIO_OPTIONS) | tr 'A-Z' 'a-z')\"" DEFINE += -DAUDIO_OPTIONS="\"$(audio)\""
DEFINE += -DVIDEO_OPTIONS="\"$(shell echo $(VIDEO_OPTIONS) | tr 'A-Z' 'a-z')\"" DEFINE += -DVIDEO_OPTIONS="\"$(video)\""
DEFINE += -DPROGRAM_VERSION="\"$(PROGRAM_VERSION)\"" DEFINE += -DPROGRAM_VERSION="\"$(PROGRAM_VERSION)\""
DEFINE += -DPROGRAM_OPTIONS="\"$(PROGRAM_OPTIONS)\"" DEFINE += -DPROGRAM_OPTIONS="\"$(PROGRAM_OPTIONS)\""
DEFINE += -DPROGRAM_BUILD="\"$(PROGRAM_BUILD)\"" DEFINE += -DPROGRAM_BUILD="\"$(PROGRAM_BUILD)\""
...@@ -138,11 +102,11 @@ endif ...@@ -138,11 +102,11 @@ endif
# #
INCLUDE += -Iinclude INCLUDE += -Iinclude
ifeq ($(VIDEO_X11),YES) ifneq (,$(findstring x11,$(video)))
INCLUDE += -I/usr/X11R6/include INCLUDE += -I/usr/X11R6/include
endif endif
ifeq ($(VIDEO_GLIDE),YES) ifneq (,$(findstring glide,$(video)))
INCLUDE += -I/usr/include/glide INCLUDE += -I/usr/include/glide
endif endif
...@@ -150,17 +114,17 @@ endif ...@@ -150,17 +114,17 @@ endif
# Libraries # Libraries
# #
LIB += -lpthread LIB += -lpthread
LIN += -lm LIB += -lm
ifeq ($(VIDEO_X11),YES) ifneq (,$(findstring x11,$(video)))
LIB += -L/usr/X11R6/lib LIB += -L/usr/X11R6/lib
LIB += -lX11 LIB += -lX11
LIB += -lXext LIB += -lXext
endif endif
ifeq ($(VIDEO_GGI),YES) ifneq (,$(findstring ggi,$(video)))
LIB += -lggi LIB += -lggi
endif endif
ifeq ($(VIDEO_GLIDE),YES) ifneq (,$(findstring glide,$(video)))
LIB += -lglide2x LIB += -lglide2x
endif endif
...@@ -242,7 +206,7 @@ interface_obj = interface/main.o \ ...@@ -242,7 +206,7 @@ interface_obj = interface/main.o \
interface/intf_ctrl.o \ interface/intf_ctrl.o \
interface/control.o \ interface/control.o \
interface/intf_console.o \ interface/intf_console.o \
$(intf_method) $(video:%=interface/intf_%.o)
input_obj = input/input_vlan.o \ input_obj = input/input_vlan.o \
input/input_file.o \ input/input_file.o \
...@@ -254,12 +218,12 @@ input_obj = input/input_vlan.o \ ...@@ -254,12 +218,12 @@ input_obj = input/input_vlan.o \
input/input.o input/input.o
audio_output_obj = audio_output/audio_output.o \ audio_output_obj = audio_output/audio_output.o \
$(aout_method) $(audio:%=audio_output/aout_%.o)
video_output_obj = video_output/video_output.o \ video_output_obj = video_output/video_output.o \
video_output/video_text.o \ video_output/video_text.o \
video_output/video_yuv.o \ video_output/video_yuv.o \
$(vout_method) $(video:%=video_output/vout_%.o)
ac3_decoder_obj = ac3_decoder/ac3_decoder.o \ ac3_decoder_obj = ac3_decoder/ac3_decoder.o \
ac3_decoder/ac3_parse.o \ ac3_decoder/ac3_parse.o \
......
...@@ -97,6 +97,7 @@ typedef struct ...@@ -97,6 +97,7 @@ typedef struct
boolean_t b_die; boolean_t b_die;
int i_channels; int i_channels;
boolean_t b_stereo;
long l_rate; long l_rate;
vlc_mutex_t data_lock; vlc_mutex_t data_lock;
...@@ -141,7 +142,8 @@ typedef int (aout_sys_reset_t) ( p_aout_thread_t p_aout ); ...@@ -141,7 +142,8 @@ typedef int (aout_sys_reset_t) ( p_aout_thread_t p_aout );
typedef int (aout_sys_setformat_t) ( p_aout_thread_t p_aout ); typedef int (aout_sys_setformat_t) ( p_aout_thread_t p_aout );
typedef int (aout_sys_setchannels_t) ( p_aout_thread_t p_aout ); typedef int (aout_sys_setchannels_t) ( p_aout_thread_t p_aout );
typedef int (aout_sys_setrate_t) ( p_aout_thread_t p_aout ); typedef int (aout_sys_setrate_t) ( p_aout_thread_t p_aout );
typedef long (aout_sys_getbufinfo_t) ( p_aout_thread_t p_aout ); typedef long (aout_sys_getbufinfo_t) ( p_aout_thread_t p_aout,
long l_buffer_limit );
typedef void (aout_sys_playsamples_t) ( p_aout_thread_t p_aout, typedef void (aout_sys_playsamples_t) ( p_aout_thread_t p_aout,
byte_t *buffer, int i_size ); byte_t *buffer, int i_size );
typedef void (aout_sys_close_t) ( p_aout_thread_t p_aout ); typedef void (aout_sys_close_t) ( p_aout_thread_t p_aout );
...@@ -186,6 +188,8 @@ typedef struct aout_thread_s ...@@ -186,6 +188,8 @@ typedef struct aout_thread_s
int i_format; int i_format;
/* Number of channels */ /* Number of channels */
int i_channels; int i_channels;
/* Mono or Stereo sound */
boolean_t b_stereo;
/* Rate and gain of the audio output sound (in Hz) */ /* Rate and gain of the audio output sound (in Hz) */
long l_rate; long l_rate;
long l_gain; long l_gain;
...@@ -203,6 +207,8 @@ typedef struct aout_thread_s ...@@ -203,6 +207,8 @@ typedef struct aout_thread_s
/* Get the fallback method */ /* Get the fallback method */
#ifdef AUDIO_DSP #ifdef AUDIO_DSP
#define AOUT_DEFAULT_METHOD "dsp" #define AOUT_DEFAULT_METHOD "dsp"
#else
#define AOUT_DEFAULT_METHOD "dummy"
#endif #endif
/* Those are from <linux/soundcard.h> but are needed because of formats /* Those are from <linux/soundcard.h> but are needed because of formats
......
...@@ -10,21 +10,23 @@ ...@@ -10,21 +10,23 @@
/***************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
*****************************************************************************/ *****************************************************************************/
#ifdef AUDIO_DUMMY
int aout_DummySysOpen ( aout_thread_t *p_aout ); int aout_DummySysOpen ( aout_thread_t *p_aout );
int aout_DummySysReset ( aout_thread_t *p_aout ); int aout_DummySysReset ( aout_thread_t *p_aout );
int aout_DummySysSetFormat ( aout_thread_t *p_aout ); int aout_DummySysSetFormat ( aout_thread_t *p_aout );
int aout_DummySysSetChannels ( aout_thread_t *p_aout ); int aout_DummySysSetChannels ( aout_thread_t *p_aout );
int aout_DummySysSetRate ( aout_thread_t *p_aout ); int aout_DummySysSetRate ( aout_thread_t *p_aout );
long aout_DummySysGetBufInfo ( aout_thread_t *p_aout ); long aout_DummySysGetBufInfo ( aout_thread_t *p_aout, long l_buffer_info );
void aout_DummySysPlaySamples ( aout_thread_t *p_aout, byte_t *buffer, int i_size ); void aout_DummySysPlaySamples ( aout_thread_t *p_aout, byte_t *buffer, int i_size );
void aout_DummySysClose ( aout_thread_t *p_aout ); void aout_DummySysClose ( aout_thread_t *p_aout );
#endif
#ifdef AUDIO_DSP #ifdef AUDIO_DSP
int aout_DspSysOpen ( aout_thread_t *p_aout ); int aout_DspSysOpen ( aout_thread_t *p_aout );
int aout_DspSysReset ( aout_thread_t *p_aout ); int aout_DspSysReset ( aout_thread_t *p_aout );
int aout_DspSysSetFormat ( aout_thread_t *p_aout ); int aout_DspSysSetFormat ( aout_thread_t *p_aout );
int aout_DspSysSetChannels ( aout_thread_t *p_aout ); int aout_DspSysSetChannels ( aout_thread_t *p_aout );
int aout_DspSysSetRate ( aout_thread_t *p_aout ); int aout_DspSysSetRate ( aout_thread_t *p_aout );
long aout_DspSysGetBufInfo ( aout_thread_t *p_aout ); 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_DspSysPlaySamples ( aout_thread_t *p_aout, byte_t *buffer, int i_size );
void aout_DspSysClose ( aout_thread_t *p_aout ); void aout_DspSysClose ( aout_thread_t *p_aout );
#endif #endif
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
/***************************************************************************** /*****************************************************************************
* Debugging options - define or undefine symbols * Debugging options - define or undefine symbols
*****************************************************************************/ *****************************************************************************/
#ifdef DEBUG #if DEBUG == 1
/* General debugging support, which depends of the DEBUG define, is determined /* General debugging support, which depends of the DEBUG define, is determined
* in the Makefile */ * in the Makefile */
......
...@@ -6,12 +6,14 @@ ...@@ -6,12 +6,14 @@
/***************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
*****************************************************************************/ *****************************************************************************/
#ifdef VIDEO_DUMMY
int vout_DummySysCreate ( p_vout_thread_t p_vout, char *psz_display, int i_root_window ); int vout_DummySysCreate ( p_vout_thread_t p_vout, char *psz_display, int i_root_window );
int vout_DummySysInit ( p_vout_thread_t p_vout ); int vout_DummySysInit ( p_vout_thread_t p_vout );
void vout_DummySysEnd ( p_vout_thread_t p_vout ); void vout_DummySysEnd ( p_vout_thread_t p_vout );
void vout_DummySysDestroy ( p_vout_thread_t p_vout ); void vout_DummySysDestroy ( p_vout_thread_t p_vout );
int vout_DummySysManage ( p_vout_thread_t p_vout ); int vout_DummySysManage ( p_vout_thread_t p_vout );
void vout_DummySysDisplay ( p_vout_thread_t p_vout ); void vout_DummySysDisplay ( p_vout_thread_t p_vout );
#endif
#ifdef VIDEO_X11 #ifdef VIDEO_X11
int vout_X11SysCreate ( p_vout_thread_t p_vout, char *psz_display, int i_root_window ); int vout_X11SysCreate ( p_vout_thread_t p_vout, char *psz_display, int i_root_window );
int vout_X11SysInit ( p_vout_thread_t p_vout ); int vout_X11SysInit ( p_vout_thread_t p_vout );
......
...@@ -182,6 +182,7 @@ static int InitThread( ac3dec_thread_t * p_ac3dec ) ...@@ -182,6 +182,7 @@ static int InitThread( ac3dec_thread_t * p_ac3dec )
aout_fifo.i_type = AOUT_ADEC_STEREO_FIFO; aout_fifo.i_type = AOUT_ADEC_STEREO_FIFO;
aout_fifo.i_channels = 2; aout_fifo.i_channels = 2;
aout_fifo.b_stereo = 1;
aout_fifo.l_frame_size = AC3DEC_FRAME_SIZE; aout_fifo.l_frame_size = AC3DEC_FRAME_SIZE;
......
...@@ -741,12 +741,14 @@ static int InitThread( adec_thread_t * p_adec ) ...@@ -741,12 +741,14 @@ static int InitThread( adec_thread_t * p_adec )
intf_DbgMsg("adec debug: mode == mono\n"); intf_DbgMsg("adec debug: mode == mono\n");
aout_fifo.i_type = AOUT_ADEC_MONO_FIFO; aout_fifo.i_type = AOUT_ADEC_MONO_FIFO;
aout_fifo.i_channels = 1; aout_fifo.i_channels = 1;
aout_fifo.b_stereo = 0;
} }
else else
{ {
intf_DbgMsg("adec debug: mode == stereo\n"); intf_DbgMsg("adec debug: mode == stereo\n");
aout_fifo.i_type = AOUT_ADEC_STEREO_FIFO; aout_fifo.i_type = AOUT_ADEC_STEREO_FIFO;
aout_fifo.i_channels = 2; aout_fifo.i_channels = 2;
aout_fifo.b_stereo = 1;
} }
/* Checking the sampling frequency */ /* Checking the sampling frequency */
......
...@@ -113,6 +113,10 @@ aout_thread_t *aout_CreateThread( int *pi_status ) ...@@ -113,6 +113,10 @@ aout_thread_t *aout_CreateThread( int *pi_status )
free( p_aout ); free( p_aout );
return( NULL ); return( NULL );
} }
p_aout->b_stereo = ( p_aout->i_channels == 2 ) ? 1 : 0; /* XXX only works
for i_channels == 1 or 2 */
if ( p_aout->p_sys_reset( p_aout ) ) if ( p_aout->p_sys_reset( p_aout ) )
{ {
p_aout->p_sys_close( p_aout ); p_aout->p_sys_close( p_aout );
...@@ -138,12 +142,6 @@ aout_thread_t *aout_CreateThread( int *pi_status ) ...@@ -138,12 +142,6 @@ aout_thread_t *aout_CreateThread( int *pi_status )
return( NULL ); return( NULL );
} }
/* this code isn't very nice since some values might be uninitialized */
/* intf_DbgMsg("aout debug: audio device (%s) opened (format=%i, channels=%i, rate=%li)\n",
p_aout->psz_device,
p_aout->i_format,
p_aout->i_channels, p_aout->l_rate); */
//?? maybe it would be cleaner to change SpawnThread prototype //?? maybe it would be cleaner to change SpawnThread prototype
//?? see vout to handle status correctly - however, it is not critical since //?? see vout to handle status correctly - however, it is not critical since
//?? this thread is only called in main and all calls are blocking //?? this thread is only called in main and all calls are blocking
...@@ -270,7 +268,7 @@ static int aout_SpawnThread( aout_thread_t * p_aout ) ...@@ -270,7 +268,7 @@ static int aout_SpawnThread( aout_thread_t * p_aout )
intf_ErrMsg("aout error: not enough memory to create the output buffer\n"); intf_ErrMsg("aout error: not enough memory to create the output buffer\n");
return( -1 ); return( -1 );
} }
if ( (p_aout->s32_buffer = (s32 *)calloc(p_aout->l_units, sizeof(s32) << ( p_aout->i_channels - 1))) == NULL ) if ( (p_aout->s32_buffer = (s32 *)calloc(p_aout->l_units, sizeof(s32) << ( p_aout->b_stereo))) == NULL )
{ {
intf_ErrMsg("aout error: not enough memory to create the s32 output buffer\n"); intf_ErrMsg("aout error: not enough memory to create the s32 output buffer\n");
free( p_aout->buffer ); free( p_aout->buffer );
...@@ -350,6 +348,7 @@ aout_fifo_t * aout_CreateFifo( aout_thread_t * p_aout, aout_fifo_t * p_fifo ) ...@@ -350,6 +348,7 @@ aout_fifo_t * aout_CreateFifo( aout_thread_t * p_aout, aout_fifo_t * p_fifo )
p_aout->fifo[i_fifo].b_die = 0; p_aout->fifo[i_fifo].b_die = 0;
p_aout->fifo[i_fifo].i_channels = p_fifo->i_channels; p_aout->fifo[i_fifo].i_channels = p_fifo->i_channels;
p_aout->fifo[i_fifo].b_stereo = p_fifo->b_stereo;
p_aout->fifo[i_fifo].l_rate = p_fifo->l_rate; p_aout->fifo[i_fifo].l_rate = p_fifo->l_rate;
p_aout->fifo[i_fifo].buffer = p_fifo->buffer; p_aout->fifo[i_fifo].buffer = p_fifo->buffer;
...@@ -364,6 +363,7 @@ aout_fifo_t * aout_CreateFifo( aout_thread_t * p_aout, aout_fifo_t * p_fifo ) ...@@ -364,6 +363,7 @@ aout_fifo_t * aout_CreateFifo( aout_thread_t * p_aout, aout_fifo_t * p_fifo )
p_aout->fifo[i_fifo].b_die = 0; p_aout->fifo[i_fifo].b_die = 0;
p_aout->fifo[i_fifo].i_channels = p_fifo->i_channels; p_aout->fifo[i_fifo].i_channels = p_fifo->i_channels;
p_aout->fifo[i_fifo].b_stereo = p_fifo->b_stereo;
p_aout->fifo[i_fifo].l_rate = p_fifo->l_rate; p_aout->fifo[i_fifo].l_rate = p_fifo->l_rate;
p_aout->fifo[i_fifo].l_frame_size = p_fifo->l_frame_size; p_aout->fifo[i_fifo].l_frame_size = p_fifo->l_frame_size;
...@@ -480,7 +480,7 @@ static __inline__ int NextFrame( aout_thread_t * p_aout, aout_fifo_t * p_fifo, m ...@@ -480,7 +480,7 @@ static __inline__ int NextFrame( aout_thread_t * p_aout, aout_fifo_t * p_fifo, m
{ {
p_fifo->b_start_frame = 1; p_fifo->b_start_frame = 1;
p_fifo->l_next_frame = (p_fifo->l_start_frame + 1) & AOUT_FIFO_SIZE; p_fifo->l_next_frame = (p_fifo->l_start_frame + 1) & AOUT_FIFO_SIZE;
p_fifo->l_unit = p_fifo->l_start_frame * (p_fifo->l_frame_size >> (p_fifo->i_channels - 1)); p_fifo->l_unit = p_fifo->l_start_frame * (p_fifo->l_frame_size >> (p_fifo->b_stereo));
break; break;
} }
p_fifo->l_start_frame = (p_fifo->l_start_frame + 1) & AOUT_FIFO_SIZE; p_fifo->l_start_frame = (p_fifo->l_start_frame + 1) & AOUT_FIFO_SIZE;
...@@ -518,7 +518,7 @@ static __inline__ int NextFrame( aout_thread_t * p_aout, aout_fifo_t * p_fifo, m ...@@ -518,7 +518,7 @@ static __inline__ int NextFrame( aout_thread_t * p_aout, aout_fifo_t * p_fifo, m
} }
} }
l_units = ((p_fifo->l_next_frame - p_fifo->l_start_frame) & AOUT_FIFO_SIZE) * (p_fifo->l_frame_size >> (p_fifo->i_channels - 1)); l_units = ((p_fifo->l_next_frame - p_fifo->l_start_frame) & AOUT_FIFO_SIZE) * (p_fifo->l_frame_size >> (p_fifo->b_stereo));
l_rate = p_fifo->l_rate + ((aout_date - p_fifo->date[p_fifo->l_start_frame]) / 256); l_rate = p_fifo->l_rate + ((aout_date - p_fifo->date[p_fifo->l_start_frame]) / 256);
// fprintf( stderr, "aout debug: %lli (%li);\n", aout_date - p_fifo->date[p_fifo->l_start_frame], l_rate ); // fprintf( stderr, "aout debug: %lli (%li);\n", aout_date - p_fifo->date[p_fifo->l_start_frame], l_rate );
...@@ -526,7 +526,7 @@ static __inline__ int NextFrame( aout_thread_t * p_aout, aout_fifo_t * p_fifo, m ...@@ -526,7 +526,7 @@ static __inline__ int NextFrame( aout_thread_t * p_aout, aout_fifo_t * p_fifo, m
InitializeIncrement( &p_fifo->unit_increment, l_rate, p_aout->l_rate ); InitializeIncrement( &p_fifo->unit_increment, l_rate, p_aout->l_rate );
p_fifo->l_units = (((l_units - (p_fifo->l_unit - p_fifo->l_units = (((l_units - (p_fifo->l_unit -
(p_fifo->l_start_frame * (p_fifo->l_frame_size >> (p_fifo->i_channels - 1))))) (p_fifo->l_start_frame * (p_fifo->l_frame_size >> (p_fifo->b_stereo)))))
* p_aout->l_rate) / l_rate) + 1; * p_aout->l_rate) / l_rate) + 1;
/* We release the lock before leaving */ /* We release the lock before leaving */
...@@ -578,7 +578,7 @@ void aout_Thread_S16_Stereo( aout_thread_t * p_aout ) ...@@ -578,7 +578,7 @@ void aout_Thread_S16_Stereo( aout_thread_t * p_aout )
if ( p_aout->fifo[i_fifo].l_units > p_aout->l_units ) if ( p_aout->fifo[i_fifo].l_units > p_aout->l_units )
{ {
l_buffer = 0; l_buffer = 0;
while ( l_buffer < (p_aout->l_units << 1) ) /* p_aout->i_channels - 1 == 1 */ while ( l_buffer < (p_aout->l_units << 1) ) /* p_aout->b_stereo == 1 */
{ {
p_aout->s32_buffer[l_buffer++] += p_aout->s32_buffer[l_buffer++] +=
(s32)( ((s16 *)p_aout->fifo[i_fifo].buffer)[p_aout->fifo[i_fifo].l_unit] ); (s32)( ((s16 *)p_aout->fifo[i_fifo].buffer)[p_aout->fifo[i_fifo].l_unit] );
...@@ -591,7 +591,7 @@ void aout_Thread_S16_Stereo( aout_thread_t * p_aout ) ...@@ -591,7 +591,7 @@ void aout_Thread_S16_Stereo( aout_thread_t * p_aout )
else else
{ {
l_buffer = 0; l_buffer = 0;
while ( l_buffer < (p_aout->fifo[i_fifo].l_units << 1) ) /* p_aout->i_channels - 1 == 1 */ while ( l_buffer < (p_aout->fifo[i_fifo].l_units << 1) ) /* p_aout->b_stereo == 1 */
{ {
p_aout->s32_buffer[l_buffer++] += p_aout->s32_buffer[l_buffer++] +=
(s32)( ((s16 *)p_aout->fifo[i_fifo].buffer)[p_aout->fifo[i_fifo].l_unit] ); (s32)( ((s16 *)p_aout->fifo[i_fifo].buffer)[p_aout->fifo[i_fifo].l_unit] );
...@@ -609,7 +609,7 @@ void aout_Thread_S16_Stereo( aout_thread_t * p_aout ) ...@@ -609,7 +609,7 @@ void aout_Thread_S16_Stereo( aout_thread_t * p_aout )
if ( p_aout->fifo[i_fifo].l_units > p_aout->l_units ) if ( p_aout->fifo[i_fifo].l_units > p_aout->l_units )
{ {
l_buffer = 0; l_buffer = 0;
while ( l_buffer < (p_aout->l_units << 1) ) /* p_aout->i_channels - 1 == 1 */ while ( l_buffer < (p_aout->l_units << 1) ) /* p_aout->b_stereo == 1 */
{ {
p_aout->s32_buffer[l_buffer++] += p_aout->s32_buffer[l_buffer++] +=
(s32)( ((s16 *)p_aout->fifo[i_fifo].buffer)[2*p_aout->fifo[i_fifo].l_unit] ); (s32)( ((s16 *)p_aout->fifo[i_fifo].buffer)[2*p_aout->fifo[i_fifo].l_unit] );
...@@ -622,7 +622,7 @@ void aout_Thread_S16_Stereo( aout_thread_t * p_aout ) ...@@ -622,7 +622,7 @@ void aout_Thread_S16_Stereo( aout_thread_t * p_aout )
else else
{ {
l_buffer = 0; l_buffer = 0;
while ( l_buffer < (p_aout->fifo[i_fifo].l_units << 1) ) /* p_aout->i_channels - 1 == 1 */ while ( l_buffer < (p_aout->fifo[i_fifo].l_units << 1) ) /* p_aout->b_stereo == 1 */
{ {
p_aout->s32_buffer[l_buffer++] += p_aout->s32_buffer[l_buffer++] +=
(s32)( ((s16 *)p_aout->fifo[i_fifo].buffer)[2*p_aout->fifo[i_fifo].l_unit] ); (s32)( ((s16 *)p_aout->fifo[i_fifo].buffer)[2*p_aout->fifo[i_fifo].l_unit] );
...@@ -660,7 +660,7 @@ void aout_Thread_S16_Stereo( aout_thread_t * p_aout ) ...@@ -660,7 +660,7 @@ void aout_Thread_S16_Stereo( aout_thread_t * p_aout )
if ( p_aout->fifo[i_fifo].l_units > l_units ) if ( p_aout->fifo[i_fifo].l_units > l_units )
{ {
l_buffer_limit = p_aout->l_units << 1; /* p_aout->i_channels - 1 == 1 */ l_buffer_limit = p_aout->l_units << 1; /* p_aout->b_stereo == 1 */
while ( l_buffer < l_buffer_limit ) while ( l_buffer < l_buffer_limit )
{ {
p_aout->s32_buffer[l_buffer++] += p_aout->s32_buffer[l_buffer++] +=
...@@ -669,10 +669,10 @@ void aout_Thread_S16_Stereo( aout_thread_t * p_aout ) ...@@ -669,10 +669,10 @@ void aout_Thread_S16_Stereo( aout_thread_t * p_aout )
(s32)( ((s16 *)p_aout->fifo[i_fifo].buffer)[p_aout->fifo[i_fifo].l_unit] ); (s32)( ((s16 *)p_aout->fifo[i_fifo].buffer)[p_aout->fifo[i_fifo].l_unit] );
UPDATE_INCREMENT( p_aout->fifo[i_fifo].unit_increment, p_aout->fifo[i_fifo].l_unit ) UPDATE_INCREMENT( p_aout->fifo[i_fifo].unit_increment, p_aout->fifo[i_fifo].l_unit )
if ( p_aout->fifo[i_fifo].l_unit >= /* p_aout->fifo[i_fifo].i_channels - 1 == 0 */ if ( p_aout->fifo[i_fifo].l_unit >= /* p_aout->fifo[i_fifo].b_stereo == 0 */
((AOUT_FIFO_SIZE + 1) * (p_aout->fifo[i_fifo].l_frame_size >> 0)) ) ((AOUT_FIFO_SIZE + 1) * (p_aout->fifo[i_fifo].l_frame_size >> 0)) )
{ {
p_aout->fifo[i_fifo].l_unit -= /* p_aout->fifo[i_fifo].i_channels - 1 == 0 */ p_aout->fifo[i_fifo].l_unit -= /* p_aout->fifo[i_fifo].b_stereo == 0 */
((AOUT_FIFO_SIZE + 1) * (p_aout->fifo[i_fifo].l_frame_size >> 0)); ((AOUT_FIFO_SIZE + 1) * (p_aout->fifo[i_fifo].l_frame_size >> 0));
} }
} }
...@@ -682,7 +682,7 @@ void aout_Thread_S16_Stereo( aout_thread_t * p_aout ) ...@@ -682,7 +682,7 @@ void aout_Thread_S16_Stereo( aout_thread_t * p_aout )
else else
{ {
l_buffer_limit = l_buffer + (p_aout->fifo[i_fifo].l_units << 1); l_buffer_limit = l_buffer + (p_aout->fifo[i_fifo].l_units << 1);
/* p_aout->i_channels - 1 == 1 */ /* p_aout->b_stereo == 1 */
while ( l_buffer < l_buffer_limit ) while ( l_buffer < l_buffer_limit )
{ {
p_aout->s32_buffer[l_buffer++] += p_aout->s32_buffer[l_buffer++] +=
...@@ -691,10 +691,10 @@ void aout_Thread_S16_Stereo( aout_thread_t * p_aout ) ...@@ -691,10 +691,10 @@ void aout_Thread_S16_Stereo( aout_thread_t * p_aout )
(s32)( ((s16 *)p_aout->fifo[i_fifo].buffer)[p_aout->fifo[i_fifo].l_unit] ); (s32)( ((s16 *)p_aout->fifo[i_fifo].buffer)[p_aout->fifo[i_fifo].l_unit] );
UPDATE_INCREMENT( p_aout->fifo[i_fifo].unit_increment, p_aout->fifo[i_fifo].l_unit ) UPDATE_INCREMENT( p_aout->fifo[i_fifo].unit_increment, p_aout->fifo[i_fifo].l_unit )
if ( p_aout->fifo[i_fifo].l_unit >= /* p_aout->fifo[i_fifo].i_channels - 1 == 0 */ if ( p_aout->fifo[i_fifo].l_unit >= /* p_aout->fifo[i_fifo].b_stereo == 0 */
((AOUT_FIFO_SIZE + 1) * (p_aout->fifo[i_fifo].l_frame_size >> 0)) )