Commit a70f8bb3 authored by Sam Hocevar's avatar Sam Hocevar

  * Mandatory step for video output IV and the audio output quality
    fix: the output threads are now spawned when a decoder needs one,
    so it can decide the audio frequency or the video window size. Still
    under heavy construction, so don't get too excited at finding bugs
    in it yet.

    Note: this change broke the XVideo module, so I made its score much
    lower than before. I suspect xvideo.so had a bug before which only
    appears now. Other video output plugins may be broken as well, but
    again this might be due to old existing bugs showing their ugly head.

  * Fixed a few buffer overflows in the Gnome interface.
  * The module bank is now a global variable. The video output bank and
    the audio output bank might follow (when they exist).
  * Coding style and organization fixes to the spdif decoder.
  * autoconf and Makefile changes by Arnaud Gomes-do-Vale
    <arnaud@carrosse.frmug.org>.
parent 7f1f24b3
......@@ -46,7 +46,7 @@ D: AC3 decoder
N: Nilmoni Deb
E: ndeb@ece.cmu.edu
D: Minor configure.in and Makefile.in fixes
D: Minor autoconf and Makefile fixes
N: Cyril Deguet
C: asmax
......@@ -75,6 +75,10 @@ D: ALSA audio output
D: input netlist
D: MPEG TS input
N: Arnaud Gomes-do-Vale
E: arnaud@carrosse.frmug.org
D: autoconf patches
N: Jean-Philippe Grimaldi
E: jeanphi@via.ecp.fr
C: jeanphi
......@@ -148,7 +152,7 @@ D: MPEG video decoder
N: Arkadiusz Miskiewicz
E: misiek@pld.ORG.PL
D: Makefile and configure patches
D: autoconf and Makefile patches
N: Olivier Pomel
E: pomel@via.ecp.fr
......@@ -169,7 +173,7 @@ D: BeOS video output (BBitmap and Overlay)
N: Espen Skoglund
E: esk@ira.uka.de
D: FreeBSD configure.in and Makefile patches
D: FreeBSD autoconf and Makefile patches
N: Benoit Steiner
E: benny@via.ecp.fr
......
......@@ -4,7 +4,16 @@
HEAD
* DVD title change no longer restart the input.
* Mandatory step for video output IV and the audio output quality
fix: the output threads are now spawned when a decoder needs one,
so it can decide the audio frequency or the video window size.
* Fixed a few buffer overflows in the Gnome interface.
* The module bank is now a global variable. The video output bank and
the audio output bank might follow (when they exist).
* Coding style and organization fixes to the spdif decoder.
* autoconf and Makefile changes by Arnaud Gomes-do-Vale
<arnaud@carrosse.frmug.org>.
* DVD title change no longer restarts the input.
* BeOS crash fix by Wade Majors <guru@startrek.com>.
* Slight modification in ClockManageRef: after a synchro reinit, we still
do the mwait and re-init last-cr.
......
......@@ -14,13 +14,13 @@ Here is a shortcut to copy-paste for a complete build:
make distclean && ./configure --prefix=/usr --enable-gnome \
--enable-fb --with-glide --with-ggi --with-sdl --enable-esd \
--enable-alsa --enable-mga --enable-gtk --enable-qt --enable-xvideo
--enable-mga --enable-gtk --enable-qt --enable-xvideo
If you intend to debug stuff, you may want to disable optimizations:
make distclean && ./configure --prefix=/usr --enable-gnome \
--enable-fb --with-glide --with-ggi --with-sdl --enable-esd \
--enable-alsa --enable-mga --enable-gtk --enable-qt --enable-xvideo \
--enable-mga --enable-gtk --enable-qt --enable-xvideo \
--disable-optimizatons
......
......@@ -40,17 +40,17 @@ INTERFACE = src/interface/main.o \
src/interface/intf_channels.o \
src/interface/intf_urldecode.o \
INPUT = src/input/input_ext-dec.o \
INPUT = src/input/input.o \
src/input/input_ext-dec.o \
src/input/input_ext-intf.o \
src/input/input_dec.o \
src/input/input_programs.o \
src/input/input_netlist.o \
src/input/input_clock.o \
src/input/input.o \
src/input/mpeg_system.o
AUDIO_OUTPUT = src/audio_output/audio_output.o \
src/audio_output/aout_fifo.o \
src/audio_output/aout_ext-dec.o \
src/audio_output/aout_u8.o \
src/audio_output/aout_s8.o \
src/audio_output/aout_u16.o \
......@@ -356,5 +356,4 @@ $(PLUGIN_OBJ): FORCE
builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
$(BUILTIN_OBJ): FORCE
cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:lib/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) $(@:%=../../%)
$(RANLIB) $@
......@@ -45,6 +45,7 @@ CC = @CC@
CFLAGS = @CFLAGS@
SHELL = @SHELL@
RANLIB = @RANLIB@
MOC = @MOC@
#
# Installation environment
......
This diff is collapsed.
......@@ -48,6 +48,7 @@ AC_CHECK_FUNC(inet_aton,,[
AC_CHECK_LIB(resolv,inet_aton,LIB="${LIB} -lresolv")
])
AC_CHECK_FUNCS(vasprintf)
AC_CHECK_FUNCS(swab)
AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
[ # FreeBSD has a gnugetopt library for this:
......@@ -392,6 +393,12 @@ AC_ARG_ENABLE(qt,
PLUGINS="${PLUGINS} qt"
ALIASES="${ALIASES} qvlc"
LIB_QT="-lqt -L${QTDIR}/lib"
if test -x ${QTDIR}/bin/moc ;
then
MOC=${QTDIR}/bin/moc
else
MOC=moc
fi
fi])
dnl
......@@ -499,6 +506,7 @@ AC_SUBST(STATS)
AC_SUBST(TRACE)
AC_SUBST(OPTIMS)
AC_SUBST(CSS)
AC_SUBST(MOC)
AC_SUBST(LCFLAGS)
AC_SUBST(LIB)
......@@ -539,8 +547,8 @@ trace mode : ${TRACE}
optimizations : ${OPTIMS}
CSS decryption : ${CSS}
need builtin getopt : ${GETOPT}
plugin modules :${PLUGINS}
built-in modules :${BUILTINS}
plugin modules :${PLUGINS}
vlc aliases :${ALIASES}
You may now tune Makefile.opts at your convenience."
......
......@@ -47,7 +47,10 @@ Disable audio output.
Specify an audio output module: "dsp", "esd", for instance.
.TP
.B \-\-stereo, \-\-mono
Choose stereo or mono audio output
Choose stereo or mono audio output.
.TP
.B \-\-spdif
Activate hardware AC3 pass-through mode.
.TP
.B \-\-novideo
Disable video output.
......@@ -145,6 +148,7 @@ also accepts a lot of parameters to customize its behaviour.
vlc_aout=<method name> audio method
vlc_dsp=<filename> dsp device path
vlc_stereo={1|0} stereo or mono output
vlc_spdif={1|0} AC3 pass-through mode
vlc_audio_rate=<rate> output rate
.TP
.B Video parameters:
......
......@@ -2,7 +2,7 @@
* audio_output.h : audio output thread interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: audio_output.h,v 1.32 2001/04/29 02:48:51 stef Exp $
* $Id: audio_output.h,v 1.33 2001/05/01 04:18:17 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
*
......@@ -21,27 +21,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Required headers:
* - "common.h" ( boolean_t )
* - "mtime.h" ( mtime_t )
* - "threads.h" ( vlc_thread_t )
*****************************************************************************/
/* TODO :
*
* - Créer un flag destroy dans les fifos audio pour indiquer au thread audio
* qu'il peut libérer la mémoire occupée par le buffer de la fifo lorsqu'il
* le désire (fin du son ou fin du thread)
*
*/
/*
* Macros
*/
#define AOUT_FIFO_ISEMPTY( fifo ) ( (fifo).l_end_frame == (fifo).l_start_frame )
#define AOUT_FIFO_ISFULL( fifo ) ( ((((fifo).l_end_frame + 1) - (fifo).l_start_frame) & AOUT_FIFO_SIZE) == 0 )
/*****************************************************************************
* aout_increment_t
*****************************************************************************
......@@ -112,23 +91,22 @@ typedef struct aout_fifo_s
} aout_fifo_t;
#define AOUT_FIFO_ISEMPTY( fifo ) \
( (fifo).l_end_frame == (fifo).l_start_frame )
#define AOUT_FIFO_ISFULL( fifo ) \
( ((((fifo).l_end_frame + 1) - (fifo).l_start_frame) & AOUT_FIFO_SIZE) == 0 )
#define AOUT_EMPTY_FIFO 0
#define AOUT_INTF_MONO_FIFO 1
#define AOUT_INTF_STEREO_FIFO 2
#define AOUT_ADEC_MONO_FIFO 3
#define AOUT_ADEC_STEREO_FIFO 4
#define AOUT_ADEC_SPDIF_FIFO 5
/*****************************************************************************
* aout_thread_t : audio output thread descriptor
*****************************************************************************/
typedef int (aout_open_t) ( p_aout_thread_t p_aout );
typedef int (aout_setformat_t) ( p_aout_thread_t p_aout );
typedef long (aout_getbufinfo_t) ( p_aout_thread_t p_aout,
long l_buffer_limit );
typedef void (aout_play_t) ( p_aout_thread_t p_aout,
byte_t *buffer, int i_size );
typedef void (aout_close_t) ( p_aout_thread_t p_aout );
typedef struct aout_thread_s
{
vlc_thread_t thread_id;
......@@ -140,11 +118,11 @@ typedef struct aout_thread_s
/* Plugin used and shortcuts to access its capabilities */
struct module_s * p_module;
aout_open_t * pf_open;
aout_setformat_t * pf_setformat;
aout_getbufinfo_t * pf_getbufinfo;
aout_play_t * pf_play;
aout_close_t * pf_close;
int ( *pf_open ) ( p_aout_thread_t );
int ( *pf_setformat ) ( p_aout_thread_t );
long ( *pf_getbufinfo ) ( p_aout_thread_t, long );
void ( *pf_play ) ( p_aout_thread_t, byte_t *, int );
void ( *pf_close ) ( p_aout_thread_t );
void * buffer;
/* The s32 buffer is used to mix all the audio fifos together before
......@@ -164,6 +142,8 @@ typedef struct aout_thread_s
char * psz_device;
int i_fd;
/* The current volume */
int i_vol;
/* Format of the audio output samples */
int i_format;
/* Number of channels */
......@@ -178,10 +158,6 @@ typedef struct aout_thread_s
* for the OSS output */
p_aout_sys_t p_sys;
/* there is the current volume */
int vol;
} aout_thread_t;
/* Those are from <linux/soundcard.h> but are needed because of formats
......@@ -205,11 +181,9 @@ typedef struct aout_thread_s
* Prototypes
*****************************************************************************/
aout_thread_t * aout_CreateThread ( int *pi_status );
void aout_DestroyThread ( aout_thread_t *p_aout,
int *pi_status );
void aout_DestroyThread ( aout_thread_t *, int * );
aout_fifo_t * aout_CreateFifo ( aout_thread_t *p_aout,
aout_fifo_t *p_fifo );
aout_fifo_t * aout_CreateFifo ( int, int, long, long, long, void * );
void aout_DestroyFifo ( aout_fifo_t *p_fifo );
void aout_FreeFifo ( aout_fifo_t *p_fifo );
......@@ -238,6 +238,10 @@
#define AOUT_STEREO_VAR "vlc_stereo"
#define AOUT_STEREO_DEFAULT 1
/* Environment variable for spdif mode */
#define AOUT_SPDIF_VAR "vlc_spdif"
#define AOUT_SPDIF_DEFAULT 0
/* Volume */
#define VOLUME_DEFAULT 512
#define VOLUME_STEP 128
......
......@@ -46,6 +46,9 @@
/* Define if you have the strtol function. */
#undef HAVE_STRTOL
/* Define if you have the swab function. */
#undef HAVE_SWAB
/* Define if you have the usleep function. */
#undef HAVE_USLEEP
......
......@@ -2,7 +2,7 @@
* input_ext-dec.h: structures exported to the VideoLAN decoders
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-dec.h,v 1.30 2001/04/28 03:36:25 sam Exp $
* $Id: input_ext-dec.h,v 1.31 2001/05/01 04:18:17 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Kaempf <maxx@via.ecp.fr>
......@@ -545,15 +545,10 @@ typedef struct vdec_config_s
*****************************************************************************
* Pointers given to audio decoders threads.
*****************************************************************************/
struct aout_thread_s;
typedef struct adec_config_s
{
struct aout_thread_s * p_aout;
struct aout_fifo_s * (* pf_create_fifo)( struct aout_thread_s *,
struct aout_fifo_s * );
void (* pf_destroy_fifo)( struct aout_thread_s *);
struct aout_fifo_s * (* pf_create_fifo)( struct aout_fifo_s * );
void (* pf_destroy_fifo)( void );
decoder_config_t decoder_config;
} adec_config_t;
......
......@@ -4,7 +4,7 @@
* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-intf.h,v 1.34 2001/04/20 05:40:03 stef Exp $
* $Id: input_ext-intf.h,v 1.35 2001/05/01 04:18:17 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -134,7 +134,6 @@ typedef struct pgrm_descriptor_s
/* Decoders control */
struct vout_thread_s * p_vout;
struct aout_thread_s * p_aout;
int i_es_number; /* size of the following array */
es_descriptor_t ** pp_es; /* array of pointers to ES */
......@@ -250,7 +249,6 @@ typedef struct i_p_config_s
*****************************************************************************
* This structure includes all the local static variables of an input thread
*****************************************************************************/
struct aout_thread_s;
struct vout_thread_s;
typedef struct input_thread_s
......@@ -305,7 +303,6 @@ typedef struct input_thread_s
stream_descriptor_t stream; /* PAT tables */
/* For auto-launch of decoders */
struct aout_thread_s * p_default_aout;
struct vout_thread_s * p_default_vout;
#ifdef STATS
......
......@@ -3,7 +3,7 @@
* Declaration and extern access to global program object.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: main.h,v 1.16 2001/04/29 02:48:51 stef Exp $
* $Id: main.h,v 1.17 2001/05/01 04:18:17 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -48,7 +48,6 @@ typedef struct
boolean_t b_audio; /* is audio output allowed ? */
boolean_t b_video; /* is video output allowed ? */
boolean_t b_channels; /* is channel changing supported ? */
boolean_t b_spdif; /* spdif mode ? */
/* Unique threads */
p_vout_thread_t p_vout; /* video output thread */
......@@ -57,7 +56,6 @@ typedef struct
/* Shared data - these structures are accessed directly from p_main by
* several modules */
struct module_bank_s * p_bank; /* module bank */
p_playlist_t p_playlist; /* playlist */
p_intf_msg_t p_msg; /* messages interface data */
p_input_channel_t p_channel; /* channel library data */
......
......@@ -2,7 +2,7 @@
* modules.h : Module management functions.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: modules.h,v 1.21 2001/04/28 03:36:25 sam Exp $
* $Id: modules.h,v 1.22 2001/05/01 04:18:17 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -25,6 +25,25 @@
#include <sys/types.h> /* off_t */
#endif
/*****************************************************************************
* bank_t, p_bank (global variable)
*****************************************************************************
* This global variable is accessed by any function using modules.
*****************************************************************************/
typedef struct
{
struct module_s * first; /* First module of the bank */
vlc_mutex_t lock; /* Global lock -- you can't imagine how awful it
is to design thread-safe linked lists. */
} bank_t;
extern bank_t *p_bank;
/*****************************************************************************
* Module #defines.
*****************************************************************************/
/* Number of tries before we unload an unused module */
#define MODULE_HIDE_DELAY 100
......@@ -224,15 +243,6 @@ typedef struct module_config_s
* Bank and module description structures
*****************************************************************************/
/* The module bank structure */
typedef struct module_bank_s
{
struct module_s * first; /* First module of the bank */
vlc_mutex_t lock; /* Global lock -- you can't imagine how awful it
is to design thread-safe linked lists. */
} module_bank_t;
/* The module description structure */
typedef struct module_s
{
......@@ -275,14 +285,10 @@ typedef struct module_s
/*****************************************************************************
* Exported functions.
*****************************************************************************/
module_bank_t * module_CreateBank ( void );
void module_InitBank ( module_bank_t * p_bank );
void module_DestroyBank ( module_bank_t * p_bank );
void module_ResetBank ( module_bank_t * p_bank );
void module_ManageBank ( module_bank_t * p_bank );
module_t * module_Need ( module_bank_t *p_bank,
int i_capabilities, void *p_data );
void module_Unneed ( module_bank_t * p_bank,
module_t * p_module );
void module_InitBank ( void );
void module_EndBank ( void );
void module_ResetBank ( void );
void module_ManageBank ( void );
module_t * module_Need ( int i_capabilities, void *p_data );
void module_Unneed ( module_t * p_module );
......@@ -21,9 +21,9 @@
*****************************************************************************/
#define ALLOCATE_BUILTIN( NAME ) \
AllocateBuiltinModule( p_bank, module_ ## NAME ## _InitModule, \
module_ ## NAME ## _ActivateModule, \
module_ ## NAME ## _DeactivateModule );
AllocateBuiltinModule( module_ ## NAME ## _InitModule, \
module_ ## NAME ## _ActivateModule, \
module_ ## NAME ## _DeactivateModule );
/* Add stuff here */
......@@ -5,7 +5,7 @@
* thread, and destroy a previously oppenned video output thread.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_output.h,v 1.57 2001/03/21 13:42:33 sam Exp $
* $Id: video_output.h,v 1.58 2001/05/01 04:18:17 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -106,6 +106,28 @@ typedef struct vout_buffer_s
byte_t * p_data; /* memory address */
} vout_buffer_t;
/*****************************************************************************
* vout_fifo_t
*****************************************************************************/
typedef struct vout_fifo_s
{
/* See the fifo types below */
int i_type;
boolean_t b_die;
int i_fifo; /* Just to keep track of the fifo index */
int i_width;
int i_height;
vlc_mutex_t data_lock;
vlc_cond_t data_wait;
} vout_fifo_t;
#define VOUT_EMPTY_FIFO 0
#define VOUT_YUV_FIFO 1
#define VOUT_SPU_FIFO 2
/*****************************************************************************
* vout_thread_t: video output thread descriptor
*****************************************************************************
......@@ -236,6 +258,11 @@ typedef struct vout_thread_s
*****************************************************************************/
vout_thread_t * vout_CreateThread ( int *pi_status );
void vout_DestroyThread ( vout_thread_t *p_vout, int *pi_status );
vout_fifo_t * vout_CreateFifo ( void );
void vout_DestroyFifo ( vout_fifo_t *p_fifo );
void vout_FreeFifo ( vout_fifo_t *p_fifo );
picture_t * vout_CreatePicture ( vout_thread_t *p_vout, int i_type,
int i_width, int i_height );
void vout_DestroyPicture ( vout_thread_t *p_vout, picture_t *p_pic );
......
......@@ -27,4 +27,5 @@ include ../../Makefile.modules
../../lib/alsa.a: $(BUILTIN_C)
ar r $@ $^
$(RANLIB) $@
......@@ -27,4 +27,5 @@ include ../../Makefile.modules
../../lib/beos.a: $(BUILTIN_CPP)
ar r $@ $^
$(RANLIB) $@
......@@ -2,7 +2,7 @@
* intf_beos.cpp: beos interface
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: intf_beos.cpp,v 1.26 2001/04/29 17:03:20 sam Exp $
* $Id: intf_beos.cpp,v 1.27 2001/05/01 04:18:17 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -281,7 +281,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
// silence the sound, otherwise very horrible
if (p_main->p_aout != NULL)
{
p_main->p_aout->vol = 0;
p_main->p_aout->i_vol = 0;
}
snooze(400000);
input_SetStatus(p_intf->p_input, INPUT_STATUS_END);
......@@ -293,7 +293,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
// {
// if (p_main->p_aout != NULL)
// {
// p_main->p_aout->vol = vol_val;
// p_main->p_aout->i_vol = vol_val;
// }
// snooze(400000);
// input_SetStatus(p_intf->p_input, INPUT_STATUS_PLAY);
......@@ -309,7 +309,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
{
if (p_main->p_aout != NULL)
{
p_main->p_aout->vol = 0;
p_main->p_aout->i_vol = 0;
}
playback_status = PAUSED;
}
......@@ -318,7 +318,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
{
if (p_main->p_aout != NULL)
{
p_main->p_aout->vol = vol_val;
p_main->p_aout->i_vol = vol_val;
}
playback_status = PLAYING;
}
......@@ -332,7 +332,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
{
if (p_main->p_aout != NULL)
{
p_main->p_aout->vol = 0;
p_main->p_aout->i_vol = 0;
}
snooze(400000);
input_SetStatus(p_intf->p_input, INPUT_STATUS_FASTER);
......@@ -344,7 +344,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
{
if (p_main->p_aout != NULL)
{
p_main->p_aout->vol = 0;
p_main->p_aout->i_vol = 0;
}
snooze(400000);
input_SetStatus(p_intf->p_input, INPUT_STATUS_SLOWER);
......@@ -357,22 +357,22 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
// adjust the volume
if (p_main->p_aout != NULL)
{
p_main->p_aout->vol = vol_val;
p_main->p_aout->i_vol = vol_val;
}
break;
case VOLUME_MUTE:
// mute
if (p_main->p_aout != NULL)
{
if (p_main->p_aout->vol == 0)
if (p_main->p_aout->i_vol == 0)
{
p_vol->SetEnabled(true);
p_main->p_aout->vol = vol_val;
p_main->p_aout->i_vol = vol_val;
}
else
{
p_vol->SetEnabled(false);
p_main->p_aout->vol = 0;
p_main->p_aout->i_vol = 0;
}
}
break;
......
......@@ -27,4 +27,5 @@ include ../../Makefile.modules
../../lib/darwin.a: $(BUILTIN_C)
ar r $@ $^
$(RANLIB) $@
......@@ -27,4 +27,5 @@ include ../../Makefile.modules
../../lib/dsp.a: $(BUILTIN_C)
ar r $@ $^
$(RANLIB) $@
......@@ -27,4 +27,5 @@ include ../../Makefile.modules
../../lib/dummy.a: $(BUILTIN_C)
ar r $@ $^
$(RANLIB) $@
......@@ -27,4 +27,5 @@ include ../../Makefile.modules
../../lib/dvd.a: $(BUILTIN_C)
ar r $@ $^
$(RANLIB) $@
......@@ -27,4 +27,5 @@ include ../../Makefile.modules
../../lib/esd.a: $(BUILTIN_C)
ar r $@ $^
$(RANLIB) $@
......@@ -27,4 +27,5 @@ include ../../Makefile.modules
../../lib/fb.a: $(BUILTIN_C)
ar r $@ $^
$(RANLIB) $@
......@@ -27,4 +27,5 @@ include ../../Makefile.modules
../../lib/ggi.a: $(BUILTIN_C)
ar r $@ $^
$(RANLIB) $@
......@@ -35,4 +35,5 @@ $(BUILTIN_GLIDE): BUILTIN_%.o: %.c
../../lib/glide.a: $(BUILTIN_GLIDE)
ar r $@ $^
$(RANLIB) $@
......@@ -35,4 +35,5 @@ $(BUILTIN_GNOME): BUILTIN_%.o: %.c
../../lib/gnome.a: $(BUILTIN_GNOME)
ar r $@ $^
$(RANLIB) $@
......@@ -2,7 +2,7 @@
* gnome_callbacks.c : Callbacks for the Gnome plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: gnome_callbacks.c,v 1.24 2001/04/22 00:08:26 stef Exp $
* $Id: gnome_callbacks.c,v 1.25 2001/05/01 04:18:18 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -1011,7 +1011,8 @@ on_disc_ok_clicked (GtkButton *button,
GTK_WIDGET(button), "disc_name" ) ) );
/* "dvd:foo" has size 5 + strlen(foo) */
psz_source = malloc( 5 + strlen( psz_device ) );
psz_source = malloc( 3 /* "dvd" */ + 1 /* ":" */
+ strlen( psz_device ) + 1 /* "\0" */ );
if( psz_source == NULL )
{
return;
......@@ -1110,7 +1111,9 @@ on_network_ok_clicked (GtkButton *button,
}
/* Allocate room for "protocol://server:port" */
psz_source = malloc( strlen( psz_protocol ) + strlen( psz_server ) + 10 );
psz_source = malloc( strlen( psz_protocol ) + 3 /* "://" */
+ strlen( psz_server ) + 1 /* ":" */
+ 5 /* 0-65535 */ + 1 /* "\0" */ );
if( psz_source == NULL )
{
return;
......
......@@ -2,7 +2,7 @@
* intf_gnome.c: Gnome interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_gnome.c,v 1.33 2001/04/29 02:48:51 stef Exp $
* $Id: intf_gnome.c,v 1.34 2001/05/01 04:18:18 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -438,13 +438,14 @@ static gint GnomeLanguageMenus( gpointer p_data,
gint i_cat,
void(*pf_toggle )( GtkCheckMenuItem *, gpointer ) )
{
#define GNOME_LANGUAGE_MENU_SIZE 64
intf_thread_t * p_intf;
GtkWidget * p_menu;
GtkWidget * p_separator;
GtkWidget * p_item;
GtkWidget * p_item_active;
GSList * p_group;
char psz_name[12];
char psz_name[ GNOME_LANGUAGE_MENU_SIZE ];
gint i_item;
gint i;
......@@ -463,7 +464,8 @@ static gint GnomeLanguageMenus( gpointer p_data,
p_menu = gtk_menu_new();
/* special case for "off" item */
sprintf( psz_name, "Off" );
snprintf( psz_name, GNOME_LANGUAGE_MENU_SIZE, "Off" );
psz_name[ GNOME_LANGUAGE_MENU_SIZE - 1 ] = '\0';
p_item = gtk_radio_menu_item_new_with_label( p_group, psz_name );
p_group = gtk_radio_menu_item_group( GTK_RADIO_MENU_ITEM( p_item ) );
......@@ -494,7 +496,9 @@ static gint GnomeLanguageMenus( gpointer p_data,
strcpy( psz_name, p_intf->p_input->stream.pp_es[i]->psz_desc );
if( psz_name[0] == '\0' )
{
sprintf( psz_name, "Language %d", i_item );
snprintf( psz_name, GNOME_LANGUAGE_MENU_SIZE,
"Language %d", i_item );
psz_name[ GNOME_LANGUAGE_MENU_SIZE - 1 ] = '\0';
}
p_item = gtk_radio_menu_item_new_with_label( p_group, psz_name );
......@@ -546,8 +550,9 @@ static gint GnomeLanguageMenus( gpointer p_data,
static gint GnomeAngleMenu( gpointer p_data, GtkWidget * p_angle,
void(*pf_toggle)( GtkCheckMenuItem *, gpointer ) )
{
#define GNOME_ANGLE_MENU_SIZE 64
intf_thread_t * p_intf;
char psz_name[12];
char psz_name[ GNOME_ANGLE_MENU_SIZE ];
GtkWidget * p_angle_menu;
GSList * p_angle_group;
GtkWidget * p_item;
......@@ -570,7 +575,8 @@ static gint GnomeAngleMenu( gpointer p_data, GtkWidget * p_angle,
i_angle < p_intf->p_input->stream.p_selected_area->i_angle_nb ;
i_angle++ )
{
sprintf( psz_name, "Angle %d", i_angle + 1 );
snprintf( psz_name, GNOME_ANGLE_MENU_SIZE, "Angle %d", i_angle + 1 );
psz_name[ GNOME_ANGLE_MENU_SIZE - 1 ] = '\0';
p_item = gtk_radio_menu_item_new_with_label( p_angle_group,
psz_name );
......@@ -657,13 +663,17 @@ static gint GnomeChapterMenu( gpointer p_data, GtkWidget * p_chapter,
gtk_menu_append( GTK_MENU( p_chapter_menu ), p_menu_item );
}
sprintf( psz_name, "%d - %d", i_chapter + 1, i_chapter + 10);
snprintf( psz_name, GNOME_ANGLE_MENU_SIZE,
"%d - %d", i_chapter + 1, i_chapter + 10);
psz_name[ GNOME_ANGLE_MENU_SIZE - 1 ] = '\0';
p_menu_item = gtk_menu_item_new_with_label( psz_name );
gtk_widget_show( p_menu_item );
p_chapter_submenu = gtk_menu_new();
}
sprintf( psz_name, "Chapter %d", i_chapter + 1 );
snprintf( psz_name, GNOME_ANGLE_MENU_SIZE,
"Chapter %d", i_chapter + 1 );
psz_name[ GNOME_ANGLE_MENU_SIZE - 1 ] = '\0';
p_item = gtk_radio_menu_item_new_with_label( p_chapter_group,
psz_name );
......@@ -732,8 +742,9 @@ static gint GnomeTitleMenu( gpointer p_data,
GtkWidget * p_navigation,
void(*pf_toggle )( GtkCheckMenuItem *, gpointer ) )
{
#define GNOME_TITLE_MENU_SIZE 64
intf_thread_t * p_intf;
char psz_name[12];
char psz_name[ GNOME_TITLE_MENU_SIZE ];
GtkWidget * p_title_menu;
GtkWidget * p_title_submenu;
GtkWidget * p_title_item;
......@@ -780,13 +791,17 @@ static gint GnomeTitleMenu( gpointer p_data,
gtk_menu_append( GTK_MENU( p_title_menu ), p_title_menu_item );
}
sprintf( psz_name, "%d - %d", i_title, i_title + 9 );
snprintf( psz_name, GNOME_TITLE_MENU_SIZE,
"%d - %d", i_title, i_title + 9 );
psz_name[ GNOME_TITLE_MENU_SIZE - 1 ] = '\0';
p_title_menu_item = gtk_menu_item_new_with_label( psz_name );
gtk_widget_show( p_title_menu_item );
p_title_submenu = gtk_menu_new();
}
sprintf( psz_name, "Title %d (%d)", i_title, p_intf->p_input->stream.pp_areas[i_title]->i_part_nb );
snprintf( psz_name, GNOME_TITLE_MENU_SIZE, "Title %d (%d)", i_title,
p_intf->p_input->stream.pp_areas[i_title]->i_part_nb );
psz_name[ GNOME_TITLE_MENU_SIZE - 1 ] = '\0';
if( pf_toggle == on_menubar_title_toggle )
{
......@@ -835,15 +850,18 @@ static gint GnomeTitleMenu( gpointer p_data,
p_chapter_menu_item );
}
sprintf( psz_name, "%d - %d", i_chapter + 1,
i_chapter + 10);
snprintf( psz_name, GNOME_TITLE_MENU_SIZE,
"%d - %d", i_chapter + 1, i_chapter + 10 );
psz_name[ GNOME_TITLE_MENU_SIZE - 1 ] = '\0';
p_chapter_menu_item =
gtk_menu_item_new_with_label( psz_name );
gtk_widget_show( p_chapter_menu_item );
p_chapter_submenu = gtk_menu_new();
}
sprintf( psz_name, "Chapter %d", i_chapter + 1 );
snprintf( psz_name, GNOME_TITLE_MENU_SIZE,
"Chapter %d", i_chapter + 1 );
psz_name[ GNOME_TITLE_MENU_SIZE - 1 ] = '\0';
p_item = gtk_radio_menu_item_new_with_label(
p_chapter_group, psz_name );
......@@ -924,7 +942,6 @@ static gint GnomeTitleMenu( gpointer p_data,
TRUE );
}
return TRUE;
}
......@@ -947,14 +964,15 @@ static gint GnomeSetupMenu( intf_thread_t * p_intf )
if( p_intf->p_sys->b_title_update )
{
char psz_title[3];
char psz_title[5];
p_menubar_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "menubar_title" ) );
GnomeTitleMenu( p_intf, p_menubar_menu, on_menubar_title_toggle );
snprintf( psz_title, 3, "%02d",
snprintf( psz_title, 5, "%d",
p_intf->p_input->stream.p_selected_area->i_id );
psz_title[ 4 ] = '\0';
gtk_label_set_text( p_intf->p_sys->p_label_title, psz_title );
p_intf->p_sys->b_title_update = 0;
......@@ -962,7 +980,7 @@ static gint GnomeSetupMenu( intf_thread_t * p_intf )
if( p_intf->p_sys->b_chapter_update )
{
char psz_chapter[3];
char psz_chapter[5];
p_popup_menu = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_popup ), "popup_navigation" ) );
......@@ -972,8 +990,9 @@ static gint GnomeSetupMenu( intf_thread_t * p_intf )
p_intf->p_sys->p_window ), "menubar_chapter" ) );
GnomeChapterMenu( p_intf, p_menubar_menu, on_menubar_chapter_toggle );
snprintf( psz_chapter, 3, "%02d",
snprintf( psz_chapter, 5, "%d",
p_intf->p_input->stream.p_selected_area->i_part );
psz_chapter[ 4 ] = '\0';
gtk_label_set_text( p_intf->p_sys->p_label_chapter, psz_chapter );
p_intf->p_sys->i_part =
......
......@@ -33,4 +33,5 @@ include ../../Makefile.modules
../../lib/gtk.a: $(BUILTIN_C)
ar r $@ $^
$(RANLIB) $@
......@@ -67,28 +67,33 @@ $(BUILTIN_IDCTALTIVEC): BUILTIN_IDCTALTIVEC_%.o: %.c
../../lib/idct.a: $(BUILTIN_IDCT)
ar r $@ $^
$(RANLIB) $@
../../lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC) $(PLUGIN_IDCTCOMMON)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../../lib/idctclassic.a: $(BUILTIN_IDCTCLASSIC)
ar r $@ $^
$(RANLIB) $@
../../lib/idctmmx.so: $(PLUGIN_IDCTMMX) $(PLUGIN_IDCTCOMMON)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../../lib/idctmmx.a: $(BUILTIN_IDCTMMX)
ar r $@ $^
$(RANLIB) $@
../../lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT) $(PLUGIN_IDCTCOMMON)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../../lib/idctmmxext.a: $(BUILTIN_IDCTMMXEXT)
ar r $@ $^
$(RANLIB) $@
../../lib/idctaltivec.so: $(PLUGIN_IDCTALTIVEC) $(PLUGIN_IDCTCOMMON)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_IDCTALTIVEC)
../../lib/idctaltivec.a: $(BUILTIN_IDCTALTIVEC)
ar r $@ $^
$(RANLIB) $@
......@@ -35,4 +35,5 @@ $(BUILTIN_MACOSX): BUILTIN_%.o: %.c
../../lib/macosx.a: $(BUILTIN_MACOSX)
ar r $@ $^
$(RANLIB) $@
......@@ -535,7 +535,7 @@ void playorpause ( intf_thread_t *p_intf )
{
if (p_main->p_aout != NULL)
{
p_main->p_aout->vol = 0;
p_main->p_aout->i_vol = 0;
}
p_main->p_vout->p_sys->playback_status = PAUSED;
SetMenuItemText( GetMenuHandle(kMenuControls), kControlsPlayORPause, "\pPlay");
......@@ -545,7 +545,7 @@ void playorpause ( intf_thread_t *p_intf )
{
if (p_main->p_aout != NULL)
{
p_main->p_aout->vol = p_main->p_vout->p_sys->vol_val;
p_main->p_aout->i_vol = p_main->p_vout->p_sys->vol_val;
}
p_main->p_vout->p_sys->playback_status = PLAYING;
SetMenuItemText( GetMenuHandle(kMenuControls), kControlsPlayORPause, "\pPause");
......@@ -563,7 +563,7 @@ void stop ( intf_thread_t *p_intf )
// silence the sound, otherwise very horrible
if (p_main->p_aout != NULL)
{
p_main->p_aout->vol = 0;
p_main->p_aout->i_vol = 0;
}
//snooze(400000);
input_SetStatus(p_intf->p_input, INPUT_STATUS_END);
......@@ -659,7 +659,7 @@ void DoMenuCommand( intf_thread_t *p_intf , long menuResult)
{
if (p_main->p_aout != NULL)
{
p_main->p_aout->vol = 0;
p_main->p_aout->i_vol = 0;
}
//snooze(400000);
input_SetStatus(p_intf->p_input, INPUT_STATUS_FASTER);
......@@ -672,7 +672,7 @@ void DoMenuCommand( intf_thread_t *p_intf , long menuResult)
{
if (p_main->p_aout != NULL)
{
p_main->p_aout->vol = 0;
p_main->p_aout->i_vol = 0;
}
//snooze(400000);
input_SetStatus(p_intf->p_input, INPUT_STATUS_SLOWER);
......@@ -706,7 +706,7 @@ void DoMenuCommand( intf_thread_t *p_intf , long menuResult)
// adjust the volume
if (p_main->p_aout != NULL)
{
p_main->p_aout->vol++;
p_main->p_aout->i_vol++;
}
break;
......@@ -714,7 +714,7 @@ void DoMenuCommand( intf_thread_t *p_intf , long menuResult)
// adjust the volume
if (p_main->p_aout != NULL)
{
p_main->p_aout->vol--;
p_main->p_aout->i_vol--;
}
break;
......@@ -722,16 +722,16 @@ void DoMenuCommand( intf_thread_t *p_intf , long menuResult)
// mute
if (p_main->p_aout != NULL)
{
if (p_main->p_aout->vol == 0)
if (p_main->p_aout->i_vol == 0)
{
//p_vol->SetEnabled(true);
p_main->p_aout->vol = p_main->p_vout->p_sys->vol_val;
p_main->p_aout->i_vol = p_main->p_vout->p_sys->vol_val;
}
else
{
//p_vol->SetEnabled(false);
p_main->p_vout->p_sys->vol_val = p_main->p_aout->vol;
p_main->p_aout->vol = 0;
p_main->p_vout->p_sys->vol_val = p_main->p_aout->i_vol;
p_main->p_aout->i_vol = 0;
}
}
break;
......
......@@ -27,4 +27,5 @@ include ../../Makefile.modules
../../lib/mga.a: $(BUILTIN_C)
ar r $@ $^
$(RANLIB) $@
......@@ -49,22 +49,26 @@ $(BUILTIN_MOTIONMMXEXT): BUILTIN_MOTIONMMXEXT_%.o: %.c
../../lib/motion.a: $(BUILTIN_MOTION)
ar r $@ $^
$(RANLIB) $@
../../lib/motionclassic.so: $(PLUGIN_MOTIONCLASSIC) $(PLUGIN_MOTIONCOMMON)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../../lib/motionclassic.a: $(BUILTIN_MOTIONCLASSIC)
ar r $@ $^
$(RANLIB) $@
../../lib/motionmmx.so: $(PLUGIN_MOTIONMMX) $(PLUGIN_MOTIONCOMMON)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../../lib/motionmmx.a: $(BUILTIN_MOTIONMMX)
ar r $@ $^
$(RANLIB) $@
../../lib/motionmmxext.so: $(PLUGIN_MOTIONMMXEXT) $(PLUGIN_MOTIONCOMMON)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../../lib/motionmmxext.a: $(BUILTIN_MOTIONMMXEXT)
ar r $@ $^
$(RANLIB) $@
......@@ -33,16 +33,19 @@ include ../../Makefile.modules
../../lib/es.a: $(BUILTIN_ES)
ar r $@ $^
$(RANLIB) $@
../../lib/ps.so: $(PLUGIN_PS)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../../lib/ps.a: $(BUILTIN_PS)
ar r $@ $^
$(RANLIB) $@
../../lib/ts.so: $(PLUGIN_TS)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_TS)
../../lib/ts.a: $(BUILTIN_TS)
ar r $@ $^
$(RANLIB) $@
......@@ -27,4 +27,5 @@ include ../../Makefile.modules
../../lib/null.a: $(BUILTIN_C)
ar r $@ $^
$(RANLIB) $@
......@@ -22,13 +22,13 @@ $(PLUGIN_QT): %.o: .dep/%.dpp
$(PLUGIN_QT): %.o: %.moc
$(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/qt -I${QTDIR}/include -c -o $@ $(<:%.moc=%.cpp)
$(PLUGIN_QT:%.o=%.moc): %.moc: %.cpp
moc -i $< -o $@
$(MOC) -i $< -o $@
$(BUILTIN_QT): BUILTIN_%.o: .dep/%.dpp
$(BUILTIN_QT): %.o: %.moc
$(CC) $(CFLAGS) -DBUILTIN -I/usr/include/qt -I${QTDIR}/include -c -o $@ $(<:BUILTIN_%.moc=%.cpp)
$(BUILTIN_QT:%.o=%.moc): BUILTIN_%.moc: %.cpp
moc -i $< -o $@
$(MOC) -i $< -o $@
#
# Real targets
......@@ -39,4 +39,5 @@ $(BUILTIN_QT:%.o=%.moc): BUILTIN_%.moc: %.cpp
../../lib/qt.a: $(BUILTIN_QT)
ar r $@ $^
$(RANLIB) $@
......@@ -27,4 +27,5 @@ include ../../Makefile.modules
../../lib/sdl.a: $(BUILTIN_C)
ar r $@ $^
$(RANLIB) $@
......@@ -31,10 +31,12 @@ include ../../Makefile.modules
../../lib/ncurses.a: $(BUILTIN_NCURSES)
ar r $@ $^
$(RANLIB) $@
../../lib/rc.so: $(PLUGIN_RC)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../../lib/rc.a: $(BUILTIN_RC)
ar r $@ $^
$(RANLIB) $@
/*****************************************************************************
* intf_rc.cpp: rc interface
* intf_rc.cpp: remote control interface
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: intf_rc.cpp,v 0.1 2001/04/27 shurdeek
......
/*****************************************************************************
* rc.cpp : stdin/stdout plugin for vlc
* rc.cpp : remote control stdin/stdout plugin for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: rc.cpp,v 0.1 2001/04/27 shurdeek
......@@ -62,7 +62,7 @@ void _M( intf_getfunctions )( function_list_t * p_function_list );
MODULE_INIT
{
p_module->psz_name = MODULE_STRING;
p_module->psz_longname = "rc interface module";
p_module->psz_longname = "remote control interface module";
p_module->psz_version = VERSION;
p_module->i_capabilities = MODULE_CAPABILITY_NULL
......
......@@ -42,6 +42,7 @@ endif
../../lib/x11.a: $(BUILTIN_X11)
ar r $@ $^
$(RANLIB) $@
../../lib/xvideo.so: $(PLUGIN_XVIDEO)
ifeq ($(SYS),nto-qnx)
......@@ -52,4 +53,5 @@ endif
../../lib/xvideo.a: $(BUILTIN_XVIDEO)
ar r $@ $^
$(RANLIB) $@
......@@ -2,7 +2,7 @@
* vout_xvideo.c: Xvideo video output display method
*****************************************************************************
* Copyright (C) 1998, 1999, 2000, 2001 VideoLAN
* $Id: vout_xvideo.c,v 1.12 2001/04/27 19:29:11 massiot Exp $
* $Id: vout_xvideo.c,v 1.13 2001/05/01 04:18:18 sam Exp $
*
* Authors: Shane Harper <shanegh@optusnet.com.au>
* Vincent Seguin <seguin@via.ecp.fr>
......@@ -207,7 +207,7 @@ static int vout_Probe( probedata_t *p_data )
return( 999 );
}
return( 110 );
return( 60 );
}
/*****************************************************************************
......
......@@ -32,10 +32,12 @@ include ../../Makefile.modules
../../lib/yuv.a: $(BUILTIN_YUV)
ar r $@ $^
$(RANLIB) $@
../../lib/yuvmmx.so: $(PLUGIN_YUVMMX)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../../lib/yuvmmx.a: $(BUILTIN_YUVMMX)
ar r $@ $^
$(RANLIB) $@
......@@ -2,7 +2,7 @@
* ac3_decoder_thread.c: ac3 decoder thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: ac3_decoder_thread.c,v 1.30 2001/04/30 21:04:20 reno Exp $
* $Id: ac3_decoder_thread.c,v 1.31 2001/05/01 04:18:18 sam Exp $
*
* Authors: Michel Lespinasse <walken@zoy.org>
*
......@@ -97,7 +97,6 @@ vlc_thread_t ac3dec_CreateThread( adec_config_t * p_config )
/*
* Initialize the output properties
*/
p_ac3dec_t->p_aout = p_config->p_aout;
p_ac3dec_t->p_aout_fifo = NULL;
/* Spawn the ac3 decoder thread */
......@@ -120,8 +119,6 @@ vlc_thread_t ac3dec_CreateThread( adec_config_t * p_config )
*****************************************************************************/
static int InitThread (ac3dec_thread_t * p_ac3dec_t)
{
aout_fifo_t aout_fifo;
intf_DbgMsg("ac3dec debug: initializing ac3 decoder thread %p",p_ac3dec_t);
p_ac3dec_t->p_config->decoder_config.pf_init_bit_stream(
......@@ -129,15 +126,10 @@ static int InitThread (ac3dec_thread_t * p_ac3dec_t)
p_ac3dec_t->p_config->decoder_config.p_decoder_fifo,
BitstreamCallback, (void *) p_ac3dec_t );
aout_fifo.i_type = AOUT_ADEC_STEREO_FIFO;
aout_fifo.i_channels = 2;
aout_fifo.b_stereo = 1;
aout_fifo.l_frame_size = AC3DEC_FRAME_SIZE;
/* Creating the audio output fifo */
if ((p_ac3dec_t->p_aout_fifo = aout_CreateFifo(p_ac3dec_t->p_aout, &aout_fifo)) == NULL)
p_ac3dec_t->p_aout_fifo = aout_CreateFifo( AOUT_ADEC_STEREO_FIFO, 2, 0, 0,
AC3DEC_FRAME_SIZE, NULL );
if ( p_ac3dec_t->p_aout_fifo == NULL )
{
return -1;
}
......
......@@ -2,7 +2,7 @@
* ac3_decoder_thread.h : ac3 decoder thread interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: ac3_decoder_thread.h,v 1.5 2001/04/20 12:14:34 reno Exp $
* $Id: ac3_decoder_thread.h,v 1.6 2001/05/01 04:18:18 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
*
......@@ -44,14 +44,12 @@ typedef struct ac3dec_thread_s
/*
* Decoder properties
*/
ac3dec_t ac3_decoder;
/*
* Output properties
*/
aout_fifo_t * p_aout_fifo; /* stores the decompressed audio frames */
aout_thread_t * p_aout; /* needed to create the audio fifo */
} ac3dec_thread_t;
......
......@@ -2,7 +2,7 @@
* ac3_iec958.c: ac3 to spdif converter
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: ac3_iec958.c,v 1.1 2001/04/29 02:48:51 stef Exp $
* $Id: ac3_iec958.c,v 1.2 2001/05/01 04:18:18 sam Exp $
*
* Authors: Stphane Borel <stef@via.ecp.fr>
* Juha Yrjola <jyrjola@cc.hut.fi>
......@@ -102,72 +102,85 @@ static const frame_size_t p_frame_size_code[64] =
/****************************************************************************
* ac3_iec958_build_burst: builds an iec958/spdif frame based on an ac3 frame
****************************************************************************/
void ac3_iec958_build_burst( int i_length, u8 * pi_data, u8 * pi_out )
void ac3_iec958_build_burst( ac3_spdif_thread_t *p_spdif )
{
const u8 pi_sync[4] = { 0x72, 0xF8, 0x1F, 0x4E };
/* add the spdif headers */
memcpy( pi_out, pi_sync, 4 );
if( i_length )
pi_out[4] = 0x01;
else
pi_out[4] = 0;
pi_out[5] = 0x00;
pi_out[6] = ( i_length *8 ) & 0xFF;
pi_out[7] = ( ( i_length *8 ) >> 8 ) & 0xFF;
swab( pi_data, pi_out + 8, i_length );
/* adds zero to complete the spdif frame
const u8 p_sync[4] = { 0x72, 0xF8, 0x1F, 0x4E };
int i_length = p_spdif->ac3_info.i_frame_size;
#ifndef HAVE_SWAB
/* Skip the first byte if i_length is odd */
u16 * p_in = (u16 *)( p_spdif->p_ac3 + ( i_length & 0x1 ) );
u16 * p_out = (u16 *)p_spdif->p_iec;
#endif
/* Add the spdif headers */
memcpy( p_spdif->p_iec, p_sync, 4 );
p_spdif->p_iec[4] = i_length ? 0x01 : 0x00;
p_spdif->p_iec[5] = 0x00;
p_spdif->p_iec[6] = ( i_length * 8 ) & 0xFF;
p_spdif->p_iec[7] = ( ( i_length * 8 ) >> 8 ) & 0xFF;
#ifdef HAVE_SWAB
swab( p_spdif->p_ac3, p_spdif->p_iec + 8, i_length );
#else
/* i_length should be even */
i_length &= ~0x1;
while( i_length )
{
*p_out = ( (*p_in & 0x00ff) << 16 ) | ( (*p_in & 0xff00) >> 16 );
p_in++;
p_out++;
i_length -= 2;
}
#endif
/* Add zeroes to complete the spdif frame,
* they will be ignored by the decoder */
memset( pi_out + 8 + i_length, 0, SPDIF_FRAME - 8 - i_length );
memset( p_spdif->p_iec + 8 + i_length, 0, SPDIF_FRAME_SIZE - 8 - i_length );
}
/****************************************************************************
* ac3_iec958_parse_syncinfo: parse ac3 sync info
****************************************************************************/
int ac3_iec958_parse_syncinfo( ac3_spdif_thread_t *p_spdif,
ac3_info_t *ac3_info,
u8 * pi_ac3 )
int ac3_iec958_parse_syncinfo( ac3_spdif_thread_t *p_spdif )
{
int pi_sample_rates[4] = { 48000, 44100, 32000, -1 };
int p_sample_rates[4] = { 48000, 44100, 32000, -1 };
int i_frame_rate_code;
int i_frame_size_code;
// u8 * pi_tmp;
sync_frame_t * p_sync_frame;
/* find sync word */
/* Find sync word */
while( ShowBits( &p_spdif->bit_stream, 16 ) != 0xb77 )
{
RemoveBits( &p_spdif->bit_stream, 8 );
}
/* read sync frame */
pi_ac3 = malloc( sizeof(sync_frame_t) );
GetChunk( &p_spdif->bit_stream, pi_ac3, sizeof(sync_frame_t) );
p_sync_frame = (sync_frame_t*)pi_ac3;
/* Read sync frame */
GetChunk( &p_spdif->bit_stream, p_spdif->p_ac3, sizeof(sync_frame_t) );
p_sync_frame = (sync_frame_t*)p_spdif->p_ac3;
/* compute frame rate */
/* Compute frame rate */
i_frame_rate_code = (p_sync_frame->syncinfo.code >> 6) & 0x03;
ac3_info->i_sample_rate = pi_sample_rates[i_frame_rate_code];
if (ac3_info->i_sample_rate == -1)
p_spdif->ac3_info.i_sample_rate = p_sample_rates[i_frame_rate_code];
if( p_spdif->ac3_info.i_sample_rate == -1 )
{
return -1;
}
/* compute frame size */
/* Compute frame size */
i_frame_size_code = p_sync_frame->syncinfo.code & 0x3f;
ac3_info->i_frame_size = 2 *
p_spdif->ac3_info.i_frame_size = 2 *
p_frame_size_code[i_frame_size_code].i_frame_size[i_frame_rate_code];
ac3_info->i_bit_rate = p_frame_size_code[i_frame_size_code].i_bit_rate;
p_spdif->ac3_info.i_bit_rate =
p_frame_size_code[i_frame_size_code].i_bit_rate;
if( ( ( p_sync_frame->bsi.bsidmod >> 3 ) & 0x1f ) != 0x08 )
{
return -1;
}
ac3_info->i_bs_mod = p_sync_frame->bsi.bsidmod & 0x7;
// free( pi_tmp );
p_spdif->ac3_info.i_bs_mod = p_sync_frame->bsi.bsidmod & 0x7;
return 0;
}
......@@ -2,7 +2,7 @@
* ac3_iec958.h: ac3 to spdif converter headers
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: ac3_iec958.h,v 1.1 2001/04/29 02:48:51 stef Exp $
* $Id: ac3_iec958.h,v 1.2 2001/05/01 04:18:18 sam Exp $
*
* Authors: Stphane Borel <stef@via.ecp.fr>
* Juha Yrjola <jyrjola@cc.hut.fi>
......@@ -23,20 +23,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
****************************************************************************/
#ifndef _AC3_IEC958_H
#define _AC3_IEC958_H
/****************************************************************************
* information about ac3 frame
****************************************************************************/
typedef struct ac3_info_s
{
int i_bit_rate;
int i_frame_size;
int i_sample_rate;
int i_bs_mod;
} ac3_info_t;
typedef struct sync_frame_s
{
struct syncinfo
......@@ -56,7 +45,6 @@ typedef struct sync_frame_s
/****************************************************************************
* Prototypes
****************************************************************************/
void ac3_iec958_build_burst ( int, u8 *, u8 * );
int ac3_iec958_parse_syncinfo ( struct ac3_spdif_thread_s *,
struct ac3_info_s *, u8 * );
#endif
void ac3_iec958_build_burst ( struct ac3_spdif_thread_s * );
int ac3_iec958_parse_syncinfo ( struct ac3_spdif_thread_s * );
......@@ -2,7 +2,7 @@
* ac3_spdif.c: ac3 pass-through to external decoder with enabled soundcard
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: ac3_spdif.c,v 1.1 2001/04/29 02:48:51 stef Exp $
* $Id: ac3_spdif.c,v 1.2 2001/05/01 04:18:18 sam Exp $
*
* Authors: Stphane Borel <stef@via.ecp.fr>
* Juha Yrjola <jyrjola@cc.hut.fi>
......@@ -69,20 +69,30 @@ vlc_thread_t spdif_CreateThread( adec_config_t * p_config )
intf_DbgMsg( "spdif debug: creating ac3 pass-through thread" );
/* Allocate the memory needed to store the thread's structure */
if( ( p_spdif = malloc( sizeof(ac3_spdif_thread_t) ) ) == NULL )
p_spdif = malloc( sizeof(ac3_spdif_thread_t) );
if( p_spdif == NULL )
{
intf_ErrMsg ( "spdif error: not enough memory "
"for spdif_CreateThread() to create the new thread");
return 0;
}
/* Temporary buffer to store ac3 frames to be transformed */
p_spdif->p_ac3 = malloc( /*ac3_info.i_frame_size*/SPDIF_FRAME_SIZE );
if( p_spdif->p_ac3 == NULL )
{
free( p_spdif->p_ac3 );
return 0;
}
/*
* Initialize the thread properties
*/
p_spdif->p_config = p_config;
p_spdif->p_fifo = p_config->decoder_config.p_decoder_fifo;
p_spdif->p_aout = p_config->p_aout;
p_spdif->p_aout_fifo = NULL;
/* Spawn the ac3 to spdif thread */
......@@ -90,6 +100,7 @@ vlc_thread_t spdif_CreateThread( adec_config_t * p_config )
(vlc_thread_func_t)RunThread, (void *)p_spdif))
{
intf_ErrMsg( "spdif error: can't spawn spdif thread" );
free( p_spdif->p_ac3 );
free( p_spdif );
return 0;
}
......@@ -108,27 +119,44 @@ vlc_thread_t spdif_CreateThread( adec_config_t * p_config )
****************************************************************************/
static int InitThread( ac3_spdif_thread_t * p_spdif )
{
aout_fifo_t aout_fifo;
p_spdif->p_config->decoder_config.pf_init_bit_stream(
&p_spdif->bit_stream,
p_spdif->p_config->decoder_config.p_decoder_fifo,
BitstreamCallback, (void*)p_spdif );
aout_fifo.i_type = AOUT_ADEC_MONO_FIFO;
aout_fifo.i_channels = 1;
aout_fifo.b_stereo = 0;
/* Creating the audio output fifo */
p_spdif->p_aout_fifo = aout_CreateFifo( AOUT_ADEC_SPDIF_FIFO, 1, 0, 0,
SPDIF_FRAME_SIZE, NULL );
if( p_spdif->p_aout_fifo == NULL )
{
return -1;
}
aout_fifo.l_frame_size = SPDIF_FRAME;
intf_WarnMsg( 1, "spdif: aout fifo created" );
/* Creating the audio output fifo */
if( (p_spdif->p_aout_fifo =
aout_CreateFifo( p_spdif->p_aout, &aout_fifo ) ) == NULL )
/* Check stream properties */
if( ac3_iec958_parse_syncinfo( p_spdif ) < 0 )
{
intf_ErrMsg( "spdif error: stream not valid");
aout_DestroyFifo( p_spdif->p_aout_fifo );
return -1;
}
intf_WarnMsg( 1, "aout fifo for spdif created" );
/* Check that we can handle the rate */
if( p_spdif->ac3_info.i_sample_rate != 48000 )
{
intf_ErrMsg( "spdif error: Only 48000 Hz streams supported");
aout_DestroyFifo( p_spdif->p_aout_fifo );
return -1;
}
GetChunk( &p_spdif->bit_stream, p_spdif->p_ac3 + sizeof(sync_frame_t),
p_spdif->ac3_info.i_frame_size - sizeof(sync_frame_t) );
vlc_cond_signal( &p_spdif->p_aout_fifo->data_wait );
return 0;
}
......@@ -139,34 +167,15 @@ static int InitThread( ac3_spdif_thread_t * p_spdif )
****************************************************************************/
static void RunThread( ac3_spdif_thread_t * p_spdif )
{
ac3_info_t ac3_info;
u8 * pi_ac3;
u8 * pi_iec;
InitThread( p_spdif );
/* temporary buffer to store ac3 frames to be transformed */
pi_ac3 = malloc( /*ac3_info.i_frame_size*/SPDIF_FRAME );
/* check stream properties */
if( ac3_iec958_parse_syncinfo( p_spdif, &ac3_info, pi_ac3 ) < 0)
/* Initializing the spdif decoder thread */
if( InitThread( p_spdif ) )
{
intf_ErrMsg( "spdif error: stream not valid");
exit(1);
}
if( ac3_info.i_sample_rate != 48000) {
intf_ErrMsg( "spdif error: Only 48000 Hz streams supported");
exit(1);
p_spdif->p_fifo->b_error = 1;
}
GetChunk( &p_spdif->bit_stream, pi_ac3 + sizeof(sync_frame_t),
ac3_info.i_frame_size - sizeof(sync_frame_t) );
vlc_cond_signal( &p_spdif->p_aout_fifo->data_wait );
while( !p_spdif->p_fifo->b_die && !p_spdif->p_fifo->b_error )
{
/* handle the dates */
/* Handle the dates */
if(DECODER_FIFO_START(*p_spdif->p_fifo)->i_pts)
{
p_spdif->p_aout_fifo->date[p_spdif->p_aout_fifo->l_end_frame] =
......@@ -179,12 +188,12 @@ static void RunThread( ac3_spdif_thread_t * p_spdif )
LAST_MDATE;
}
/* write in the first free packet of aout fifo */
pi_iec = (p_spdif->p_aout_fifo->buffer) +
(p_spdif->p_aout_fifo->l_end_frame * SPDIF_FRAME );
/* Write in the first free packet of aout fifo */
p_spdif->p_iec = (p_spdif->p_aout_fifo->buffer) +
(p_spdif->p_aout_fifo->l_end_frame * SPDIF_FRAME_SIZE );
/* build burst to be sent to hardware decoder */
ac3_iec958_build_burst( ac3_info.i_frame_size, pi_ac3, pi_iec );
/* Build burst to be sent to hardware decoder */
ac3_iec958_build_burst( p_spdif );
vlc_mutex_lock (&p_spdif->p_aout_fifo->data_lock);
......@@ -193,18 +202,17 @@ static void RunThread( ac3_spdif_thread_t * p_spdif )
vlc_mutex_unlock (&p_spdif->p_aout_fifo->data_lock);
/* find syncword */
/* Find syncword */
while( ShowBits( &p_spdif->bit_stream, 16 ) != 0xb77 )
{
RemoveBits( &p_spdif->bit_stream, 8 );
}
/* read data from bitstream */
GetChunk( &p_spdif->bit_stream, pi_ac3, ac3_info.i_frame_size );
/* Read data from bitstream */
GetChunk( &p_spdif->bit_stream, p_spdif->p_ac3,
p_spdif->ac3_info.i_frame_size );
}
free( pi_ac3 );
/* If b_error is set, the ac3 spdif thread enters the error loop */
if( p_spdif->p_fifo->b_error )
{
......@@ -267,6 +275,7 @@ static void EndThread( ac3_spdif_thread_t * p_spdif )
/* Destroy descriptor */
free( p_spdif->p_config );
free( p_spdif->p_ac3 );
free( p_spdif );
intf_DbgMsg ("spdif debug: thread %p destroyed", p_spdif );
......
......@@ -2,7 +2,7 @@
* ac3_spdif.h: header for ac3 pass-through
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: ac3_spdif.h,v 1.1 2001/04/29 02:48:51 stef Exp $
* $Id: ac3_spdif.h,v 1.2 2001/05/01 04:18:18 sam Exp $
*
* Authors: Stéphane Borel <stef@via.ecp.fr>
*
......@@ -21,10 +21,15 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
****************************************************************************/
#ifndef _AC3_SPDIF_H
#define _AC3_SPDIF_H
#define SPDIF_FRAME_SIZE 6144
#define SPDIF_FRAME 6144
typedef struct ac3_info_s
{
int i_bit_rate;
int i_frame_size;
int i_sample_rate;
int i_bs_mod;
} ac3_info_t;
/*****************************************************************************
* ac3_spdif_thread_t : ac3 pass-through thread descriptor
......@@ -45,12 +50,18 @@ typedef struct ac3_spdif_thread_s
/* The bit stream structure handles the PES stream at the bit level */
bit_stream_t bit_stream;
int i_available;
/*
* Decoder properties
*/
ac3_info_t ac3_info;
u8 * p_ac3;
u8 * p_iec;
/*
* Output properties
*/
aout_fifo_t * p_aout_fifo;/* stores the decompressed audio frames */
aout_thread_t * p_aout; /* needed to create the audio fifo */
aout_fifo_t * p_aout_fifo; /* stores the decompressed audio frames */
} ac3_spdif_thread_t;
......@@ -59,4 +70,3 @@ typedef struct ac3_spdif_thread_s
*****************************************************************************/
vlc_thread_t spdif_CreateThread( adec_config_t * p_config );
#endif
......@@ -2,7 +2,7 @@
* audio_decoder.c: MPEG audio decoder thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: audio_decoder.c,v 1.49 2001/04/25 10:22:32 massiot Exp $
* $Id: audio_decoder.c,v 1.50 2001/05/01 04:18:18 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
......@@ -102,7 +102,6 @@ vlc_thread_t adec_CreateThread ( adec_config_t * p_config )
/*
* Initialize the output properties
*/
p_adec->p_aout = p_config->p_aout;
p_adec->p_aout_fifo = NULL;
/* Spawn the audio decoder thread */
......@@ -128,21 +127,15 @@ vlc_thread_t adec_CreateThread ( adec_config_t * p_config )
*****************************************************************************/
static int InitThread (adec_thread_t * p_adec)
{
aout_fifo_t aout_fifo;
intf_DbgMsg ("adec debug: initializing audio decoder thread %p", p_adec);
p_adec->p_config->decoder_config.pf_init_bit_stream( &p_adec->bit_stream,
p_adec->p_config->decoder_config.p_decoder_fifo, NULL, NULL );
aout_fifo.i_type = AOUT_ADEC_STEREO_FIFO;
aout_fifo.i_channels = 2;
aout_fifo.b_stereo = 1;
aout_fifo.l_frame_size = ADEC_FRAME_SIZE;
/* Creating the audio output fifo */
if ( (p_adec->p_aout_fifo =
aout_CreateFifo(p_adec->p_aout, &aout_fifo)) == NULL )
p_adec->p_aout_fifo = aout_CreateFifo( AOUT_ADEC_STEREO_FIFO, 2, 0, 0,
ADEC_FRAME_SIZE, NULL );
if ( p_adec->p_aout_fifo == NULL )
{
return -1;
}
......@@ -164,9 +157,6 @@ static void RunThread (adec_thread_t * p_adec)
intf_DbgMsg ( "adec debug: running audio decoder thread (%p) (pid == %i)",
p_adec, getpid() );
/* You really suck */
//msleep ( INPUT_PTS_DELAY );
/* Initializing the audio decoder thread */
p_adec->p_fifo->b_error = InitThread (p_adec);
......
......@@ -2,7 +2,7 @@
* audio_decoder.h : audio decoder thread interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: audio_decoder.h,v 1.6 2001/03/21 13:42:34 sam Exp $
* $Id: audio_decoder.h,v 1.7 2001/05/01 04:18:18 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
*
......@@ -52,7 +52,6 @@ typedef struct adec_thread_s
* Output properties
*/
struct aout_fifo_s * p_aout_fifo; /* stores the decompressed frames */
struct aout_thread_s * p_aout; /* needed to create the audio fifo */
} adec_thread_t;
......
......@@ -2,7 +2,7 @@
* aout_common.h: audio output inner functions
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: aout_common.h,v 1.3 2001/04/29 02:48:51 stef Exp $
* $Id: aout_common.h,v 1.4 2001/05/01 04:18:18 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
*
......@@ -45,8 +45,6 @@ void aout_SpdifThread ( aout_thread_t * p_aout );
(integer) += (increment).l_euclidean_integer; \
}
#define FIFO p_aout->fifo[i_fifo]
/*****************************************************************************
* InitializeIncrement
*****************************************************************************/
......
/*****************************************************************************
* aout_fifo.c : exported fifo management functions
* aout_ext-dec.c : exported fifo management functions
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: aout_fifo.c,v 1.2 2001/03/21 13:42:34 sam Exp $
* $Id: aout_ext-dec.c,v 1.1 2001/05/01 04:18:18 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
*
......@@ -39,115 +39,137 @@
#include "audio_output.h"
#include "aout_common.h"
#include "main.h"
/*****************************************************************************
* aout_CreateFifo
*****************************************************************************/
aout_fifo_t * aout_CreateFifo( aout_thread_t * p_aout, aout_fifo_t * p_fifo )
aout_fifo_t * aout_CreateFifo( int i_type, int i_channels, long l_rate,
long l_units, long l_frame_size,
void *p_buffer )
{
#define P_AOUT p_main->p_aout
int i_fifo;
/* Spawn an audio output if there is none */
if( P_AOUT == NULL )
{
P_AOUT = aout_CreateThread( NULL );
if( P_AOUT == NULL )
{
return NULL;
}
}
/* Take the fifos lock */
vlc_mutex_lock( &p_aout->fifos_lock );
vlc_mutex_lock( &P_AOUT->fifos_lock );
/* Looking for a free fifo structure */
for ( i_fifo = 0; i_fifo < AOUT_MAX_FIFOS; i_fifo++ )
for( i_fifo = 0; i_fifo < AOUT_MAX_FIFOS; i_fifo++ )
{
if ( p_aout->fifo[i_fifo].i_type == AOUT_EMPTY_FIFO)
if( P_AOUT->fifo[i_fifo].i_type == AOUT_EMPTY_FIFO )
{
/* Not very clever, but at least we know which fifo it is */
p_aout->fifo[i_fifo].i_fifo = i_fifo;
P_AOUT->fifo[i_fifo].i_fifo = i_fifo;
break;
}
}
if ( i_fifo == AOUT_MAX_FIFOS )
if( i_fifo == AOUT_MAX_FIFOS )
{
intf_ErrMsg( "aout error: no fifo available" );
vlc_mutex_unlock( &p_aout->fifos_lock );
vlc_mutex_unlock( &P_AOUT->fifos_lock );
return( NULL );
}
/* Initialize the new fifo structure */
switch ( p_aout->fifo[i_fifo].i_type = p_fifo->i_type )
switch ( P_AOUT->fifo[i_fifo].i_type = i_type )
{
case AOUT_INTF_MONO_FIFO:
case AOUT_INTF_STEREO_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].b_stereo = p_fifo->b_stereo;
p_aout->fifo[i_fifo].l_rate = p_fifo->l_rate;
P_AOUT->fifo[i_fifo].i_channels = i_channels;
P_AOUT->fifo[i_fifo].b_stereo = ( i_channels == 2 );
P_AOUT->fifo[i_fifo].l_rate = l_rate;
p_aout->fifo[i_fifo].buffer = p_fifo->buffer;
P_AOUT->fifo[i_fifo].buffer = p_buffer;
p_aout->fifo[i_fifo].l_unit = 0;
InitializeIncrement( &p_aout->fifo[i_fifo].unit_increment,
p_fifo->l_rate, p_aout->l_rate );
p_aout->fifo[i_fifo].l_units = p_fifo->l_units;
P_AOUT->fifo[i_fifo].l_unit = 0;
InitializeIncrement( &P_AOUT->fifo[i_fifo].unit_increment,
l_rate, P_AOUT->l_rate );
P_AOUT->fifo[i_fifo].l_units = l_units;
break;
case AOUT_ADEC_MONO_FIFO:
case AOUT_ADEC_STEREO_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].b_stereo = p_fifo->b_stereo;
p_aout->fifo[i_fifo].l_rate = p_fifo->l_rate;
P_AOUT->fifo[i_fifo].i_channels = i_channels;
P_AOUT->fifo[i_fifo].b_stereo = ( i_channels == 2 );
P_AOUT->fifo[i_fifo].l_rate = l_rate;
p_aout->fifo[i_fifo].l_frame_size = p_fifo->l_frame_size;
P_AOUT->fifo[i_fifo].l_frame_size = l_frame_size;
/* Allocate the memory needed to store the audio frames. As the
* fifo is a rotative fifo, we must be able to find out whether the
* fifo is full or empty, that's why we must in fact allocate memory
* for (AOUT_FIFO_SIZE+1) audio frames. */
p_aout->fifo[i_fifo].buffer = malloc( sizeof(s16)*(AOUT_FIFO_SIZE+1)*p_fifo->l_frame_size );
if ( p_aout->fifo[i_fifo].buffer == NULL )
* fifo is a rotative fifo, we must be able to find out whether
* the fifo is full or empty, that's why we must in fact allocate
* memory for (AOUT_FIFO_SIZE+1) audio frames. */
P_AOUT->fifo[i_fifo].buffer = malloc( sizeof(s16) *
( AOUT_FIFO_SIZE + 1 ) * l_frame_size );
if ( P_AOUT->fifo[i_fifo].buffer == NULL )
{
intf_ErrMsg( "aout error: cannot create frame buffer" );
p_aout->fifo[i_fifo].i_type = AOUT_EMPTY_FIFO;
vlc_mutex_unlock( &p_aout->fifos_lock );
P_AOUT->fifo[i_fifo].i_type = AOUT_EMPTY_FIFO;
vlc_mutex_unlock( &P_AOUT->fifos_lock );
return( NULL );
}
/* Allocate the memory needed to store the dates of the frames */
p_aout->fifo[i_fifo].date = (mtime_t *)malloc( sizeof(mtime_t)*(AOUT_FIFO_SIZE+1) );
if ( p_aout->fifo[i_fifo].date == NULL )
P_AOUT->fifo[i_fifo].date =
malloc( sizeof(mtime_t) * ( AOUT_FIFO_SIZE + 1) );
if ( P_AOUT->fifo[i_fifo].date == NULL )
{
intf_ErrMsg( "aout error: cannot create date buffer");
free( p_aout->fifo[i_fifo].buffer );
p_aout->fifo[i_fifo].i_type = AOUT_EMPTY_FIFO;
vlc_mutex_unlock( &p_aout->fifos_lock );
free( P_AOUT->fifo[i_fifo].buffer );
P_AOUT->fifo[i_fifo].i_type = AOUT_EMPTY_FIFO;
vlc_mutex_unlock( &P_AOUT->fifos_lock );
return( NULL );
}
/* Set the fifo's buffer as empty (the first frame that is to be
* played is also the first frame that is not to be played) */
p_aout->fifo[i_fifo].l_start_frame = 0;
/* p_aout->fifo[i_fifo].l_next_frame = 0; */
p_aout->fifo[i_fifo].l_end_frame = 0;
P_AOUT->fifo[i_fifo].l_start_frame = 0;
/* P_AOUT->fifo[i_fifo].l_next_frame = 0; */
P_AOUT->fifo[i_fifo].l_end_frame = 0;
/* Waiting for the audio decoder to compute enough frames to work
* out the fifo's current rate (as soon as the decoder has decoded
* enough frames, the members of the fifo structure that are not
* initialized now will be calculated) */
p_aout->fifo[i_fifo].b_start_frame = 0;
p_aout->fifo[i_fifo].b_next_frame = 0;
P_AOUT->fifo[i_fifo].b_start_frame = 0;
P_AOUT->fifo[i_fifo].b_next_frame = 0;
break;
default:
intf_ErrMsg( "aout error: unknown fifo type 0x%x", p_aout->fifo[i_fifo].i_type );
p_aout->fifo[i_fifo].i_type = AOUT_EMPTY_FIFO;
vlc_mutex_unlock( &p_aout->fifos_lock );
intf_ErrMsg( "aout error: unknown fifo type 0x%x",
P_AOUT->fifo[i_fifo].i_type );
P_AOUT->fifo[i_fifo].i_type = AOUT_EMPTY_FIFO;
vlc_mutex_unlock( &P_AOUT->fifos_lock );
return( NULL );
}
/* Release the fifos lock */
vlc_mutex_unlock( &p_aout->fifos_lock );
vlc_mutex_unlock( &P_AOUT->fifos_lock );
intf_WarnMsg( 2, "aout info: fifo #%i allocated, %i channels, rate %li",
p_aout->fifo[i_fifo].i_fifo, p_aout->fifo[i_fifo].i_channels, p_aout->fifo[i_fifo].l_rate );
P_AOUT->fifo[i_fifo].i_fifo, P_AOUT->fifo[i_fifo].i_channels,
P_AOUT->fifo[i_fifo].l_rate );
/* Return the pointer to the fifo structure */
return( &FIFO );
return( &P_AOUT->fifo[i_fifo] );
#undef P_AOUT
}
/*****************************************************************************
......
......@@ -82,7 +82,7 @@ void aout_S16StereoThread( aout_thread_t * p_aout )
{
((s16 *)p_aout->buffer)[l_buffer] =
(s16)( ( p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS )
* p_aout->vol / 256 ) ;
* p_aout->i_vol / 256 ) ;
p_aout->s32_buffer[l_buffer] = 0;
}
......
......@@ -2,7 +2,7 @@
* aout_u8.c: 8 bit unsigned audio output functions
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: aout_u8.c,v 1.2 2001/03/21 13:42:34 sam Exp $
* $Id: aout_u8.c,v 1.3 2001/05/01 04:18:18 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
*
......@@ -77,7 +77,7 @@ void aout_U8MonoThread( aout_thread_t * p_aout )
for ( l_buffer = 0; l_buffer < l_buffer_limit; l_buffer++ )
{
((u8 *)p_aout->buffer)[l_buffer] = (u8)( ( (p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS / 256 ) + 128 ) * p_aout->vol / 256 );
((u8 *)p_aout->buffer)[l_buffer] = (u8)( ( (p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS / 256 ) + 128 ) * p_aout->i_vol / 256 );
p_aout->s32_buffer[l_buffer] = 0;
}
......@@ -131,7 +131,7 @@ void aout_U8StereoThread( aout_thread_t * p_aout )
for ( l_buffer = 0; l_buffer < l_buffer_limit; l_buffer++ )
{
((u8 *)p_aout->buffer)[l_buffer] = (u8)( ( (p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS / 256) + 128 ) * p_aout->vol / 256 );
((u8 *)p_aout->buffer)[l_buffer] = (u8)( ( (p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS / 256) + 128 ) * p_aout->i_vol / 256 );
p_aout->s32_buffer[l_buffer] = 0;
}
l_bytes = p_aout->pf_getbufinfo( p_aout, l_buffer_limit );
......
......@@ -2,7 +2,7 @@
* audio_output.c : audio output thread
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: audio_output.c,v 1.58 2001/04/29 02:48:51 stef Exp $
* $Id: audio_output.c,v 1.59 2001/05/01 04:18:18 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
*
......@@ -82,8 +82,7 @@ aout_thread_t *aout_CreateThread( int *pi_status )
}
/* Choose the best module */
p_aout->p_module = module_Need( p_main->p_bank,
MODULE_CAPABILITY_AOUT, NULL );
p_aout->p_module = module_Need( MODULE_CAPABILITY_AOUT, NULL );
if( p_aout->p_module == NULL )
{
......@@ -105,7 +104,7 @@ aout_thread_t *aout_CreateThread( int *pi_status )
*/
if ( p_aout->pf_open( p_aout ) )
{
module_Unneed( p_main->p_bank, p_aout->p_module );
module_Unneed( p_aout->p_module );
free( p_aout );
return( NULL );
}
......@@ -114,13 +113,13 @@ aout_thread_t *aout_CreateThread( int *pi_status )
{
intf_ErrMsg( "aout error: null sample rate" );
p_aout->pf_close( p_aout );
module_Unneed( p_main->p_bank, p_aout->p_module );
module_Unneed( p_aout->p_module );
free( p_aout );
return( NULL );
}
/* special setting for ac3 pass-through mode */
if( p_main->b_spdif )
if( main_GetIntVariable( AOUT_SPDIF_VAR, 0 ) )
{
p_aout->i_format = AOUT_FMT_AC3;
p_aout->i_channels = 1;
......@@ -133,13 +132,13 @@ aout_thread_t *aout_CreateThread( int *pi_status )
if ( p_aout->pf_setformat( p_aout ) )
{
p_aout->pf_close( p_aout );
module_Unneed( p_main->p_bank, p_aout->p_module );
module_Unneed( p_aout->p_module );
free( p_aout );
return( NULL );
}
/* Initialize the volume level */
p_aout->vol = VOLUME_DEFAULT;
p_aout->i_vol = VOLUME_DEFAULT;
/* FIXME: maybe it would be cleaner to change SpawnThread prototype
* see vout to handle status correctly ?? however, it is not critical since
......@@ -147,7 +146,7 @@ aout_thread_t *aout_CreateThread( int *pi_status )
if( aout_SpawnThread( p_aout ) )
{
p_aout->pf_close( p_aout );
module_Unneed( p_main->p_bank, p_aout->p_module );
module_Unneed( p_aout->p_module );
free( p_aout );
return( NULL );
}
......@@ -337,7 +336,7 @@ void aout_DestroyThread( aout_thread_t * p_aout, int *pi_status )
p_aout->pf_close( p_aout );
/* Release the aout module */
module_Unneed( p_main->p_bank, p_aout->p_module );
module_Unneed( p_aout->p_module );
/* Free structure */
free( p_aout );
......
......@@ -4,7 +4,7 @@
* decoders.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input.c,v 1.103 2001/04/28 23:19:19 henri Exp $
* $Id: input.c,v 1.104 2001/05/01 04:18:18 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -144,7 +144,6 @@ input_thread_t *input_CreateThread ( playlist_item_t *p_item, int *pi_status )
p_input->stream.control.b_bw = 0;
/* Initialize default settings for spawned decoders */
p_input->p_default_aout = p_main->p_aout;
p_input->p_default_vout = p_main->p_vout;
/* Create thread and set locks. */
......@@ -318,8 +317,7 @@ static int InitThread( input_thread_t * p_input )
p_input->c_packets_trashed = 0;
#endif
p_input->p_input_module = module_Need( p_main->p_bank,
MODULE_CAPABILITY_INPUT,
p_input->p_input_module = module_Need( MODULE_CAPABILITY_INPUT,
(probedata_t *)p_input );
if( p_input->p_input_module == NULL )
......@@ -350,7 +348,7 @@ static int InitThread( input_thread_t * p_input )
{
/* We barfed -- exit nicely */
p_input->pf_close( p_input );
module_Unneed( p_main->p_bank, p_input->p_input_module );
module_Unneed( p_input->p_input_module );
return( -1 );
}
......@@ -360,7 +358,7 @@ static int InitThread( input_thread_t * p_input )
{
/* We barfed -- exit nicely */
p_input->pf_close( p_input );
module_Unneed( p_main->p_bank, p_input->p_input_module );
module_Unneed( p_input->p_input_module );
return( -1 );
}
......@@ -414,7 +412,7 @@ static void EndThread( input_thread_t * p_input )
p_input->pf_close( p_input );
/* Release modules */
module_Unneed( p_main->p_bank, p_input->p_input_module );
module_Unneed( p_input->p_input_module );
}
......
......@@ -2,7 +2,7 @@
* input_programs.c: es_descriptor_t, pgrm_descriptor_t management
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_programs.c,v 1.53 2001/04/29 02:48:51 stef Exp $
* $Id: input_programs.c,v 1.54 2001/05/01 04:18:18 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -174,8 +174,6 @@ pgrm_descriptor_t * input_AddProgram( input_thread_t * p_input,
p_input->stream.pp_programs[i_pgrm_index]->p_vout
= p_input->p_default_vout;
p_input->stream.pp_programs[i_pgrm_index]->p_aout
= p_input->p_default_aout;
if( i_data_len )
{
......@@ -580,7 +578,7 @@ static adec_config_t * GetAdecConfig( input_thread_t * p_input,
intf_ErrMsg( "Unable to allocate memory in GetAdecConfig" );
return( NULL );
}
p_config->p_aout = p_input->p_default_aout;
if( InitDecConfig( p_input, p_es, &p_config->decoder_config ) == -1 )
{
free( p_config );
......@@ -661,13 +659,13 @@ int input_SelectES( input_thread_t * p_input, es_descriptor_t * p_es )
case AC3_AUDIO_ES:
if( p_main->b_audio )
{
if( !p_main->b_spdif )
if( main_GetIntVariable( AOUT_SPDIF_VAR, 0 ) )
{
decoder.pf_create_thread = ac3dec_CreateThread;
decoder.pf_create_thread = spdif_CreateThread;
}
else
{
decoder.pf_create_thread = spdif_CreateThread;
decoder.pf_create_thread = ac3dec_CreateThread;
}
p_config = (void *)GetAdecConfig( p_input, p_es );
......
......@@ -4,7 +4,7 @@
* interface, such as command line.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: interface.c,v 1.74 2001/04/30 15:00:59 massiot Exp $
* $Id: interface.c,v 1.75 2001/05/01 04:18:18 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -81,8 +81,7 @@ intf_thread_t* intf_Create( void )
}
/* Choose the best module */
p_intf->p_module = module_Need( p_main->p_bank,
MODULE_CAPABILITY_INTF, NULL );
p_intf->p_module = module_Need( MODULE_CAPABILITY_INTF, NULL );
if( p_intf->p_module == NULL )
{
......@@ -111,7 +110,7 @@ intf_thread_t* intf_Create( void )
if( p_intf->pf_open( p_intf ) )
{
intf_ErrMsg("intf error: cannot create interface");
module_Unneed( p_main->p_bank, p_intf->p_module );
module_Unneed( p_intf->p_module );
free( p_intf );
return( NULL );
}
......@@ -142,7 +141,7 @@ static void intf_Manage( intf_thread_t *p_intf )
intf_FlushMsg();
/* Manage module bank */
module_ManageBank( p_main->p_bank );
module_ManageBank( );
if( ( p_intf->p_input != NULL ) &&
( p_intf->p_input->b_error || p_intf->p_input->b_eof ) )
......@@ -205,7 +204,7 @@ void intf_Destroy( intf_thread_t *p_intf )
}
/* Unlock module */
module_Unneed( p_main->p_bank, p_intf->p_module );
module_Unneed( p_intf->p_module );
vlc_mutex_destroy( &p_intf->change_lock );
......@@ -336,21 +335,21 @@ int intf_ProcessKey( intf_thread_t *p_intf, int g_key )
* half handled directly by the plugins. We should decide what to do. */
break;
case INTF_KEY_INC_VOLUME: /* volume + */
if( (p_main->p_aout != NULL) && (p_main->p_aout->vol < VOLUME_MAX) )
p_main->p_aout->vol += VOLUME_STEP;
if( (p_main->p_aout != NULL) && (p_main->p_aout->i_vol < VOLUME_MAX) )
p_main->p_aout->i_vol += VOLUME_STEP;
break;
case INTF_KEY_DEC_VOLUME: /* volume - */
if( (p_main->p_aout != NULL) && (p_main->p_aout->vol > VOLUME_STEP) )
p_main->p_aout->vol -= VOLUME_STEP;
if( (p_main->p_aout != NULL) && (p_main->p_aout->i_vol > VOLUME_STEP) )
p_main->p_aout->i_vol -= VOLUME_STEP;
break;
case INTF_KEY_TOGGLE_VOLUME: /* toggle mute */
if( (p_main->p_aout != NULL) && (p_main->p_aout->vol))
if( (p_main->p_aout != NULL) && (p_main->p_aout->i_vol))
{
i_volbackup = p_main->p_aout->vol;
p_main->p_aout->vol = 0;
i_volbackup = p_main->p_aout->i_vol;
p_main->p_aout->i_vol = 0;
}
else if( (p_main->p_aout != NULL) && (!p_main->p_aout->vol))
p_main->p_aout->vol = i_volbackup;
else if( (p_main->p_aout != NULL) && (!p_main->p_aout->i_vol))
p_main->p_aout->i_vol = i_volbackup;
break;
case INTF_KEY_DEC_GAMMA: /* gamma - */
if( (p_main->p_vout != NULL) && (p_main->p_vout->f_gamma > -INTF_GAMMA_LIMIT) )
......
......@@ -4,7 +4,7 @@
* and spawn threads.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: main.c,v 1.90 2001/04/29 02:48:51 stef Exp $
* $Id: main.c,v 1.91 2001/05/01 04:18:18 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -182,9 +182,11 @@ static const struct option longopts[] =
static const char *psz_shortopts = "hHvgt:T:u:a:s:c:I:A:V:";
/*****************************************************************************
* Global variable program_data - this is the one and only, see main.h
* Global variable program_data - these are the only ones, see main.h and
* modules.h
*****************************************************************************/
main_t *p_main;
bank_t *p_bank;
/*****************************************************************************
* Local prototypes
......@@ -214,8 +216,18 @@ static int CPUCapabilities ( void );
int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
{
main_t main_data; /* root of all data - see main.h */
bank_t module_bank;
p_main = &main_data; /* set up the global variable */
p_main = &main_data; /* set up the global variables */
p_bank = &module_bank;
/*
* Initialize the main structure
*/
p_main->i_cpu_capabilities = CPUCapabilities();
p_main->p_aout = NULL;
p_main->p_vout = NULL;
/*
* System specific initialization code
......@@ -224,8 +236,6 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
system_Create( &i_argc, ppsz_argv, ppsz_env );
#endif
p_main->i_cpu_capabilities = CPUCapabilities();
/*
* Test if our code is likely to run on this CPU
*/
......@@ -272,7 +282,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
/*
* Initialize playlist and get commandline files
*/
p_main->p_playlist = intf_PlaylistCreate( );
p_main->p_playlist = intf_PlaylistCreate();
if( !p_main->p_playlist )
{
intf_ErrMsg( "playlist error: playlist initialization failed" );
......@@ -289,15 +299,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
/*
* Initialize module bank
*/
p_main->p_bank = module_CreateBank( );
if( !p_main->p_bank )
{
intf_ErrMsg( "module error: module bank initialization failed" );
intf_PlaylistDestroy( p_main->p_playlist );
intf_MsgDestroy();
return( errno );
}
module_InitBank( p_main->p_bank );
module_InitBank();
/*
* Initialize shared resources and libraries
......@@ -317,7 +319,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
if( !p_main->p_intf )
{
intf_ErrMsg( "intf error: interface initialization failed" );
module_DestroyBank( p_main->p_bank );
module_EndBank();
intf_PlaylistDestroy( p_main->p_playlist );
intf_MsgDestroy();
return( errno );
......@@ -328,58 +330,28 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
*/
InitSignalHandler();
/*
* Open audio device and start aout thread
*/
if( p_main->b_audio )
{
p_main->p_aout = aout_CreateThread( NULL );
if( p_main->p_aout == NULL )
{
/* On error during audio initialization, switch off audio */
intf_ErrMsg( "aout error: audio initialization failed,"
" audio is deactivated" );
p_main->b_audio = 0;
}
}
/*
* Open video device and start vout thread
*/
if( p_main->b_video )
{
p_main->p_vout = vout_CreateThread( NULL );
if( p_main->p_vout == NULL )
{
/* On error during video initialization, switch off video */
intf_ErrMsg( "vout error: video initialization failed,"
" video is deactivated" );
p_main->b_video = 0;
}
}
/* Flush messages before entering the main loop */
intf_FlushMsg();
/*
* This is the main loop
*/
p_main->p_intf->pf_run( p_main->p_intf );
/*
* Finished, destroy the interface
*/
intf_Destroy( p_main->p_intf );
/*
* Close video device
* Close all video devices
*/
if( p_main->b_video )
if( p_main->p_vout != NULL )
{
vout_DestroyThread( p_main->p_vout, NULL );
}
/*
* Close audio device
* Close all audio devices
*/
if( p_main->b_audio )
if( p_main->p_aout != NULL )
{
aout_DestroyThread( p_main->p_aout, NULL );
}
......@@ -395,7 +367,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
/*
* Free module bank
*/
module_DestroyBank( p_main->p_bank );
module_EndBank();
/*
* Free playlist
......@@ -524,7 +496,6 @@ static int GetConfiguration( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] )
p_main->b_audio = 1;
p_main->b_video = 1;
p_main->b_channels = 0;
p_main->b_spdif = 0;
p_main->i_warning_level = 4;
......@@ -609,7 +580,7 @@ static int GetConfiguration( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] )
main_PutIntVariable( AOUT_STEREO_VAR, 0 );
break;
case OPT_SPDIF: /* --spdif */
p_main->b_spdif = 1;
main_PutIntVariable( AOUT_SPDIF_VAR, 1 );
break;
/* Video options */
......@@ -763,7 +734,7 @@ static void Usage( int i_fashion )
"\n --noaudio \tdisable audio"
"\n -A, --aout <module> \taudio output method"
"\n --stereo, --mono \tstereo/mono audio"
"\n --spdif \tac3 pass-through mode"
"\n --spdif \tAC3 pass-through mode"
"\n"
"\n --novideo \tdisable video"
"\n -V, --vout <module> \tvideo output method"
......@@ -809,6 +780,7 @@ static void Usage( int i_fashion )
"\n " AOUT_METHOD_VAR "=<method name> \taudio method"
"\n " AOUT_DSP_VAR "=<filename> \tdsp device path"
"\n " AOUT_STEREO_VAR "={1|0} \tstereo or mono output"
"\n " AOUT_SPDIF_VAR "={1|0} \tAC3 pass-through mode"
"\n " AOUT_RATE_VAR "=<rate> \toutput rate" );
/* Video parameters */
......
......@@ -2,7 +2,7 @@
* lpcm_decoder_thread.c: lpcm decoder thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: lpcm_decoder_thread.c,v 1.13 2001/04/06 09:15:48 sam Exp $
* $Id: lpcm_decoder_thread.c,v 1.14 2001/05/01 04:18:18 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -84,7 +84,6 @@ vlc_thread_t lpcmdec_CreateThread (adec_config_t * p_config)
/*
* Initialize the output properties
*/
p_lpcmdec->p_aout = p_config->p_aout;
p_lpcmdec->p_aout_fifo = NULL;
/* Spawn the lpcm decoder thread */
......@@ -105,7 +104,6 @@ vlc_thread_t lpcmdec_CreateThread (adec_config_t * p_config)
*****************************************************************************/
static int InitThread (lpcmdec_thread_t * p_lpcmdec)
{
aout_fifo_t aout_fifo;
lpcm_byte_stream_t * byte_stream;
intf_DbgMsg ( "LPCM Debug: initializing lpcm decoder thread %p", p_lpcmdec );
......@@ -127,14 +125,11 @@ static int InitThread (lpcmdec_thread_t * p_lpcmdec)
byte_stream->info = p_lpcmdec;
vlc_mutex_unlock (&p_lpcmdec->p_fifo->data_lock);
aout_fifo.i_type = AOUT_ADEC_STEREO_FIFO;
aout_fifo.i_channels = 2;
aout_fifo.b_stereo = 1;
aout_fifo.l_frame_size = LPCMDEC_FRAME_SIZE;
/* Creating the audio output fifo */
if ((p_lpcmdec->p_aout_fifo = aout_CreateFifo(p_lpcmdec->p_aout, &aout_fifo)) == NULL) {
p_lpcmdec->p_aout_fifo = aout_CreateFifo( AOUT_ADEC_STEREO_FIFO, 2, 0, 0,
LPCMDEC_FRAME_SIZE, NULL );
if ( p_lpcmdec->p_aout_fifo == NULL )
{
return -1;
}
......
......@@ -2,7 +2,7 @@
* lpcm_decoder_thread.h : lpcm decoder thread interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: lpcm_decoder_thread.h,v 1.4 2001/03/21 13:42:34 sam Exp $
* $Id: lpcm_decoder_thread.h,v 1.5 2001/05/01 04:18:18 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -43,14 +43,12 @@ typedef struct lpcmdec_thread_s
/*
* Decoder properties
*/
lpcmdec_t lpcm_decoder;
/*
* Output properties
*/
aout_fifo_t * p_aout_fifo; /* stores the decompressed audio frames */
aout_thread_t * p_aout; /* needed to create the audio fifo */
} lpcmdec_thread_t;
......@@ -58,3 +56,4 @@ typedef struct lpcmdec_thread_s
* Prototypes
*****************************************************************************/
vlc_thread_t lpcmdec_CreateThread( adec_config_t * p_config );
......@@ -2,7 +2,7 @@
* modules.c : Built-in and plugin modules management functions
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: modules.c,v 1.27 2001/04/28 03:36:25 sam Exp $
* $Id: modules.c,v 1.28 2001/05/01 04:18:18 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Ethan C. Baldridge <BaldridgeE@cadmus.com>
......@@ -60,19 +60,18 @@
#include "intf_msg.h"
#include "modules.h"
#ifdef HAVE_DYNAMIC_PLUGINS
#include "modules_core.h"
# include "modules_core.h"
#endif
#include "modules_builtin.h"
/* Local prototypes */
#ifdef HAVE_DYNAMIC_PLUGINS
static int AllocatePluginModule ( module_bank_t *, char * );
static int AllocatePluginModule ( char * );
#endif
static int AllocateBuiltinModule( module_bank_t *,
int ( * ) ( module_t * ),
static int AllocateBuiltinModule( int ( * ) ( module_t * ),
int ( * ) ( module_t * ),
int ( * ) ( module_t * ) );
static int DeleteModule ( module_bank_t * p_bank, module_t * );
static int DeleteModule ( module_t * );
static int LockModule ( module_t * );
static int UnlockModule ( module_t * );
#ifdef HAVE_DYNAMIC_PLUGINS
......@@ -80,27 +79,13 @@ static int HideModule ( module_t * );
static int CallSymbol ( module_t *, char * );
#endif
/*****************************************************************************
* module_CreateBank: create the module bank.
*****************************************************************************
* This function creates a module bank structure.
*****************************************************************************/
module_bank_t * module_CreateBank( void )
{
module_bank_t * p_bank;
p_bank = malloc( sizeof( module_bank_t ) );
return( p_bank );
}
/*****************************************************************************
* module_InitBank: create the module bank.
*****************************************************************************
* This function creates a module bank structure and fills it with the
* built-in modules, as well as all the plugin modules it can find.
*****************************************************************************/
void module_InitBank( module_bank_t * p_bank )
void module_InitBank( )
{
#ifdef HAVE_DYNAMIC_PLUGINS
static char * path[] = { ".", "lib", PLUGIN_PATH, NULL, NULL };
......@@ -120,8 +105,6 @@ void module_InitBank( module_bank_t * p_bank )
p_bank->first = NULL;
vlc_mutex_init( &p_bank->lock );
intf_WarnMsg( 1, "module: module bank initialized" );
intf_WarnMsg( 2, "module: checking built-in modules" );
ALLOCATE_ALL_BUILTINS();
......@@ -178,7 +161,7 @@ void module_InitBank( module_bank_t * p_bank )
/* We created a nice filename -- now we just try to load
* it as a plugin module. */
AllocatePluginModule( p_bank, psz_file );
AllocatePluginModule( psz_file );
/* We don't care if the allocation succeeded */
free( psz_file );
......@@ -198,22 +181,24 @@ void module_InitBank( module_bank_t * p_bank )
}
#endif /* HAVE_DYNAMIC_PLUGINS */
intf_WarnMsg( 1, "module: module bank initialized" );
return;
}
/*****************************************************************************
* module_DestroyBank: destroy the module bank.
* module_EndBank: destroy the module bank.
*****************************************************************************
* This function unloads all unused plugin modules and removes the module
* bank in case of success.
*****************************************************************************/
void module_DestroyBank( module_bank_t * p_bank )
void module_EndBank( )
{
module_t * p_next;
while( p_bank->first != NULL )
{
if( DeleteModule( p_bank, p_bank->first ) )
if( DeleteModule( p_bank->first ) )
{
/* Module deletion failed */
intf_ErrMsg( "module error: `%s' can't be removed. trying harder.",
......@@ -228,9 +213,6 @@ void module_DestroyBank( module_bank_t * p_bank )
/* Destroy the lock */
vlc_mutex_destroy( &p_bank->lock );
/* We can free the module bank */
free( p_bank );
return;
}
......@@ -241,7 +223,7 @@ void module_DestroyBank( module_bank_t * p_bank )
* This function resets the module bank by unloading all unused plugin
* modules.
*****************************************************************************/
void module_ResetBank( module_bank_t * p_bank )
void module_ResetBank( )
{
intf_ErrMsg( "FIXME: module_ResetBank unimplemented" );
return;
......@@ -253,7 +235,7 @@ void module_ResetBank( module_bank_t * p_bank )
* This function parses the module bank and hides modules that have been
* unused for a while.
*****************************************************************************/
void module_ManageBank( module_bank_t * p_bank )
void module_ManageBank( )
{
#ifdef HAVE_DYNAMIC_PLUGINS
module_t * p_module;
......@@ -297,8 +279,7 @@ void module_ManageBank( module_bank_t * p_bank )
*****************************************************************************
* This function returns the module that best fits the asked capabilities.
*****************************************************************************/
module_t * module_Need( module_bank_t *p_bank,
int i_capabilities, void *p_data )
module_t * module_Need( int i_capabilities, void *p_data )
{
module_t * p_module;
module_t * p_bestmodule = NULL;
......@@ -379,7 +360,7 @@ module_t * module_Need( module_bank_t *p_bank,
* This function must be called by the thread that called module_Need, to
* decrease the reference count and allow for hiding of modules.
*****************************************************************************/
void module_Unneed( module_bank_t * p_bank, module_t * p_module )
void module_Unneed( module_t * p_module )
{
/* We take the global lock */
vlc_mutex_lock( &p_bank->lock );
......@@ -408,7 +389,7 @@ void module_Unneed( module_bank_t * p_bank, module_t * p_module )
* for its information data. The module can then be handled by module_Need,
* module_Unneed and HideModule. It can be removed by DeleteModule.
*****************************************************************************/
static int AllocatePluginModule( module_bank_t * p_bank, char * psz_filename )
static int AllocatePluginModule( char * psz_filename )
{
module_t * p_module, * p_othermodule;
module_handle_t handle;
......@@ -527,8 +508,7 @@ static int AllocatePluginModule( module_bank_t * p_bank, char * psz_filename )
* for its information data. The module can then be handled by module_Need,
* module_Unneed and HideModule. It can be removed by DeleteModule.
*****************************************************************************/
static int AllocateBuiltinModule( module_bank_t * p_bank,
int ( *pf_init ) ( module_t * ),
static int AllocateBuiltinModule( int ( *pf_init ) ( module_t * ),
int ( *pf_activate ) ( module_t * ),
int ( *pf_deactivate ) ( module_t * ) )
{
......@@ -627,7 +607,7 @@ static int AllocateBuiltinModule( module_bank_t * p_bank,
*****************************************************************************
* This function can only be called if i_usage <= 0.
*****************************************************************************/
static int DeleteModule( module_bank_t * p_bank, module_t * p_module )
static int DeleteModule( module_t * p_module )
{
/* If the module is not in use but is still in memory, we first have
* to hide it and remove it from memory before we can free the
......
......@@ -5,7 +5,7 @@
* thread, and destroy a previously oppened video output thread.
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: video_output.c,v 1.121 2001/04/27 19:29:11 massiot Exp $
* $Id: video_output.c,v 1.122 2001/05/01 04:18:18 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -109,8 +109,7 @@ vout_thread_t * vout_CreateThread ( int *pi_status )
}
/* Choose the best module */
p_vout->p_module = module_Need( p_main->p_bank,
MODULE_CAPABILITY_VOUT, NULL );
p_vout->p_module = module_Need( MODULE_CAPABILITY_VOUT, NULL );
if( p_vout->p_module == NULL )
{
......@@ -197,7 +196,7 @@ vout_thread_t * vout_CreateThread ( int *pi_status )
* own error messages */
if( p_vout->pf_create( p_vout ) )
{
module_Unneed( p_main->p_bank, p_vout->p_module );
module_Unneed( p_vout->p_module );
free( p_vout );
return( NULL );
}
......@@ -1312,7 +1311,7 @@ static void DestroyThread( vout_thread_t *p_vout, int i_status )
vlc_mutex_destroy( &p_vout->change_lock );
/* Release the module */
module_Unneed( p_main->p_bank, p_vout->p_module );
module_Unneed( p_vout->p_module );
/* Free structure */
free( p_vout );
......
......@@ -3,7 +3,7 @@
* These functions set up YUV tables for colorspace conversion
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_yuv.c,v 1.47 2001/03/21 13:42:35 sam Exp $
* $Id: video_yuv.c,v 1.48 2001/05/01 04:18:18 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -45,8 +45,6 @@
#include "intf_msg.h"
#include "main.h"
/*****************************************************************************
* vout_InitYUV: allocate and initialize translation tables
*****************************************************************************
......@@ -56,8 +54,7 @@
int vout_InitYUV( vout_thread_t *p_vout )
{
/* Choose the best module */
p_vout->yuv.p_module = module_Need( p_main->p_bank,
MODULE_CAPABILITY_YUV, NULL );
p_vout->yuv.p_module = module_Need( MODULE_CAPABILITY_YUV, NULL );
if( p_vout->yuv.p_module == NULL )
{
......@@ -94,6 +91,6 @@ int vout_ResetYUV( vout_thread_t *p_vout )
void vout_EndYUV( vout_thread_t *p_vout )
{
p_vout->yuv.pf_end( p_vout );
module_Unneed( p_main->p_bank, p_vout->yuv.p_module );
module_Unneed( p_vout->yuv.p_module );
}
......@@ -2,7 +2,7 @@
* video_parser.c : video parser thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_parser.c,v 1.81 2001/04/29 14:52:42 stef Exp $
* $Id: video_parser.c,v 1.82 2001/05/01 04:18:18 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
......@@ -60,17 +60,14 @@
#include "../video_decoder/video_parser.h"
#include "../video_decoder/video_fifo.h"
#include "main.h"
/*
* Local prototypes
*/
static int InitThread ( vpar_thread_t *p_vpar );
static void RunThread ( vpar_thread_t *p_vpar );
static void ErrorThread ( vpar_thread_t *p_vpar );
static void EndThread ( vpar_thread_t *p_vpar );
static void BitstreamCallback ( bit_stream_t *p_bit_stream,
boolean_t b_new_pes );
static int InitThread ( vpar_thread_t * );
static void RunThread ( vpar_thread_t * );
static void ErrorThread ( vpar_thread_t * );
static void EndThread ( vpar_thread_t * );
static void BitstreamCallback ( bit_stream_t *, boolean_t );
/*****************************************************************************
* vpar_CreateThread: create a generic parser thread
......@@ -103,8 +100,7 @@ vlc_thread_t vpar_CreateThread( vdec_config_t * p_config )
/*
* Choose the best motion compensation module
*/
p_vpar->p_motion_module = module_Need( p_main->p_bank,
MODULE_CAPABILITY_MOTION, NULL );
p_vpar->p_motion_module = module_Need( MODULE_CAPABILITY_MOTION, NULL );
if( p_vpar->p_motion_module == NULL )
{
......@@ -113,69 +109,68 @@ vlc_thread_t vpar_CreateThread( vdec_config_t * p_config )
return( 0 );
}
#define m ( p_vpar->pppf_motion )
#define s ( p_vpar->ppf_motion_skipped )
#define f ( p_vpar->p_motion_module->p_functions->motion.functions.motion )
m[0][0][0] = m[0][0][1] = m[0][0][2] = m[0][0][3] = NULL;
m[0][1][0] = m[0][1][1] = m[0][1][2] = m[0][1][3] = NULL;
m[1][0][0] = NULL;
m[1][1][0] = NULL;
m[2][0][0] = NULL;
m[2][1][0] = NULL;
m[3][0][0] = NULL;
m[3][1][0] = NULL;
m[1][0][1] = f.pf_field_field_420;
m[1][1][1] = f.pf_frame_field_420;
m[2][0][1] = f.pf_field_field_422;
m[2][1][1] = f.pf_frame_field_422;
m[3][0][1] = f.pf_field_field_444;
m[3][1][1] = f.pf_frame_field_444;
m[1][0][2] = f.pf_field_16x8_420;
m[1][1][2] = f.pf_frame_frame_420;
m[2][0][2] = f.pf_field_16x8_422;
m[2][1][2] = f.pf_frame_frame_422;
m[3][0][2] = f.pf_field_16x8_444;
m[3][1][2] = f.pf_frame_frame_444;
m[1][0][3] = f.pf_field_dmv_420;
m[1][1][3] = f.pf_frame_dmv_420;
m[2][0][3] = f.pf_field_dmv_422;
m[2][1][3] = f.pf_frame_dmv_422;
m[3][0][3] = f.pf_field_dmv_444;
m[3][1][3] = f.pf_frame_dmv_444;
s[0][0] = s[0][1] = s[0][2] = s[0][3] = NULL;
s[1][0] = NULL;
s[2][0] = NULL;
s[3][0] = NULL;
s[1][1] = f.pf_field_field_420;
s[2][1] = f.pf_field_field_422;
s[3][1] = f.pf_field_field_444;
s[1][2] = f.pf_field_field_420;
s[2][2] = f.pf_field_field_422;
s[3][2] = f.pf_field_field_444;
s[1][3] = f.pf_frame_frame_420;
s[2][3] = f.pf_frame_frame_422;
s[3][3] = f.pf_frame_frame_444;
#undef f
#undef s
#undef m
#define M ( p_vpar->pppf_motion )
#define S ( p_vpar->ppf_motion_skipped )
#define F ( p_vpar->p_motion_module->p_functions->motion.functions.motion )
M[0][0][0] = M[0][0][1] = M[0][0][2] = M[0][0][3] = NULL;
M[0][1][0] = M[0][1][1] = M[0][1][2] = M[0][1][3] = NULL;
M[1][0][0] = NULL;
M[1][1][0] = NULL;
M[2][0][0] = NULL;
M[2][1][0] = NULL;
M[3][0][0] = NULL;
M[3][1][0] = NULL;
M[1][0][1] = F.pf_field_field_420;
M[1][1][1] = F.pf_frame_field_420;
M[2][0][1] = F.pf_field_field_422;
M[2][1][1] = F.pf_frame_field_422;
M[3][0][1] = F.pf_field_field_444;
M[3][1][1] = F.pf_frame_field_444;
M[1][0][2] = F.pf_field_16x8_420;
M[1][1][2] = F.pf_frame_frame_420;
M[2][0][2] = F.pf_field_16x8_422;
M[2][1][2] = F.pf_frame_frame_422;
M[3][0][2] = F.pf_field_16x8_444;
M[3][1][2] = F.pf_frame_frame_444;
M[1][0][3] = F.pf_field_dmv_420;
M[1][1][3] = F.pf_frame_dmv_420;
M[2][0][3] = F.pf_field_dmv_422;
M[2][1][3] = F.pf_frame_dmv_422;
M[3][0][3] = F.pf_field_dmv_444;
M[3][1][3] = F.pf_frame_dmv_444;
S[0][0] = S[0][1] = S[0][2] = S[0][3] = NULL;
S[1][0] = NULL;
S[2][0] = NULL;
S[3][0] = NULL;
S[1][1] = F.pf_field_field_420;
S[2][1] = F.pf_field_field_422;
S[3][1] = F.pf_field_field_444;
S[1][2] = F.pf_field_field_420;
S[2][2] = F.pf_field_field_422;
S[3][2] = F.pf_field_field_444;
S[1][3] = F.pf_frame_frame_420;
S[2][3] = F.pf_frame_frame_422;
S[3][3] = F.pf_frame_frame_444;
#undef F
#undef S
#undef M
/*
* Choose the best IDCT module
*/
p_vpar->p_idct_module = module_Need( p_main->p_bank,
MODULE_CAPABILITY_IDCT, NULL );
p_vpar->p_idct_module = module_Need( MODULE_CAPABILITY_IDCT, NULL );
if( p_vpar->p_idct_module == NULL )
{
intf_ErrMsg( "vpar error: no suitable IDCT module" );
module_Unneed( p_main->p_bank, p_vpar->p_motion_module );
module_Unneed( p_vpar->p_motion_module );
free( p_vpar );
return( 0 );
}
......@@ -192,8 +187,8 @@ vlc_thread_t vpar_CreateThread( vdec_config_t * p_config )
(vlc_thread_func_t)RunThread, (void *)p_vpar ) )
{
intf_ErrMsg("vpar error: can't spawn video parser thread");
module_Unneed( p_main->p_bank, p_vpar->p_idct_module );
module_Unneed( p_main->p_bank, p_vpar->p_motion_module );
module_Unneed( p_vpar->p_idct_module );
module_Unneed( p_vpar->p_motion_module );
free( p_vpar );
return( 0 );
}
......@@ -506,8 +501,8 @@ static void EndThread( vpar_thread_t *p_vpar )
vlc_mutex_destroy( &(p_vpar->synchro.fifo_lock) );
module_Unneed( p_main->p_bank, p_vpar->p_idct_module );
module_Unneed( p_main->p_bank, p_vpar->p_motion_module );
module_Unneed( p_vpar->p_idct_module );
module_Unneed( p_vpar->p_motion_module );
free( p_vpar );
......
......@@ -2,7 +2,7 @@
* vpar_headers.c : headers parsing
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vpar_headers.c,v 1.82 2001/04/28 03:36:26 sam Exp $
* $Id: vpar_headers.c,v 1.83 2001/05/01 04:18:18 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Stphane Borel <stef@via.ecp.fr>
......@@ -53,6 +53,8 @@
#include "../video_decoder/video_parser.h"
#include "../video_decoder/video_fifo.h"
#include "main.h" /* XXX REMOVE THIS */
/*
* Local prototypes
*/
......@@ -448,6 +450,13 @@ static void SequenceHeader( vpar_thread_t * p_vpar )
/* Extension and User data */
ExtensionAndUserData( p_vpar );
/* XXX: The vout request and fifo opening will eventually be here */
if( p_main->p_vout == NULL )
{
intf_Msg( "vpar: no vout present, spawning one" );
p_main->p_vout = p_vpar->p_vout = vout_CreateThread( NULL );
}
}
/*****************************************************************************
......
Name: vlc
Version: 0.2.73
Release: 1
Release: 2
Copyright: GPL
Url: http://www.videolan.org/
Group: X11/Applications/Graphics
Source0: http://www.videolan.org/packages/0.2.73/vlc-0.2.73.tar.gz
Prefix: /usr
Packager: Samuel Hocevar <sam@zoy.org>
Buildroot: /tmp/vlc-build
Summary: VideoLAN Client.
Summary(fr): Client VideoLAN.
%changelog
* Mon Apr 30 2001 Arnaud Gomes-do-Vale <arnaud@glou.org>
Added relocation support and compile fixes for Red Hat 7.x.
* Sat Apr 28 2001 Henri Fallon <henri@videolan.org>
New upstream release (0.2.73)
......@@ -42,21 +47,37 @@ a free network-aware MPEG and DVD player
The VideoLAN Client allows to play MPEG2 Transport Streams from the
network or from a file, as well as direct DVD playback.
%description -l fr
Un lecteur MPEG et DVD utilisable en rseau.
VideoLAN est un lecteur MPEG1/2. Le client VideoLAN permet la lecture de
flux MPEG2 depuis le rseau ou depuis un fichier, en plus de la lecture
directe des DVD.
%prep
%setup
%build
./configure --prefix=/usr --with-sdl --enable-esd --enable-gnome --enable-qt
make
if [ -x %{prefix}/bin/kgcc ] ;
then
CC=%{prefix}/bin/kgcc ./configure --prefix=%{prefix} --with-sdl --enable-esd --enable-gnome --enable-qt
else
./configure --prefix=%{prefix} --with-sdl --enable-esd --enable-gnome --enable-qt
fi
if [ -x %{prefix}/bin/kgcc ] ;
then
CC=%{prefix}/bin/kgcc make
else
make
fi
%install
mkdir -p $RPM_BUILD_ROOT/usr/lib
mkdir -p $RPM_BUILD_ROOT/usr/bin
make install prefix=$RPM_BUILD_ROOT/usr
mkdir -p $RPM_BUILD_ROOT%{prefix}/lib
mkdir -p $RPM_BUILD_ROOT%{prefix}/bin
make install prefix=$RPM_BUILD_ROOT%{prefix}
%files
%attr(-, root, root) /usr/bin/vlc
%attr(-, root, root) /usr/share/videolan
%attr(-, root, root) /usr/lib/videolan
%attr(-, root, root) %{prefix}/bin/vlc
%attr(-, root, root) %{prefix}/share/videolan
%attr(-, root, root) %{prefix}/lib/videolan
%attr(-, root, root) %doc ChangeLog AUTHORS COPYING INSTALL README TODO doc
%clean
rm -rf $RPM_BUILD_ROOT
......
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