Commit 9a726693 authored by Sam Hocevar's avatar Sam Hocevar

9 avril:

 - r�indentation de quelques bouts de code
 - les plugins vont �tre cherch�s en priorit� dans . puis ./plugins
  puis dans le r�pertoire habituel
 - d�but de communication entre le thread gnome et l'input
 - l'interface gnome ne segfaulte plus en sortant
 - le menu "Exit" fonctionne

10 avril:
 - fen�tre Gnome au lieu de fen�tre Gtk
  *** ATTENTION *** l'interface Gnome n'est vraiment qu'un d�but, soyez
   gentils de ne pas faire de bug report si un bouton ne fonctionne pas.
 - popup "About"

11 avril:
 - fen�tre playlist (rien dedans encore)
 - masquage du pointeur souris
 - popup menu dans la fen�tre vout
 - hide/show des fen�tres playlist
 - les boutons "Exit" fonctionnent quel que soit le menu

12 avril:
 - d�but du cassage des channels
 - d�but des menus g�n�r�s en runtime

13 avril:
 - ajout du target "snapshot" dans le makefile

14 avril:
 - d�codage de tous les sous-titres connus
 - spu_decoder.c ne segfaulte plus quand on quitte
 - rajout du flag b_active dans la structure audio_decoder
 - le bouton pause fonctionne
parent 3efee782
......@@ -356,6 +356,21 @@ show:
@echo "Command line for assembler objects:"
@echo $(CC) $(CFLAGS) -c -o "<dest.o>" "<src.S>"
# ugliest of all, but I have no time to do it -- sam
snapshot:
rm -rf /tmp/${SNAPSHOTDIR}
mkdir /tmp/${SNAPSHOTDIR}
cp -a * /tmp/${SNAPSHOTDIR}
(cd /tmp/${SNAPSHOTDIR} ; \
make distclean ; \
find . -type d -name CVS | xargs rm -rf ; \
find . -type f -name '.*.swp' | xargs rm -f ; \
cd .. ; \
tar czvf ${SNAPSHOTDIR}.tar.gz ${SNAPSHOTDIR} )
rm -rf /tmp/${SNAPSHOTDIR}
mv /tmp/${SNAPSHOTDIR}.tar.gz ..
@echo "Sources are in ../${SNAPSHOTDIR}.tar.gz"
FORCE:
#
......
......@@ -179,6 +179,7 @@ typedef struct aout_thread_s
{
vlc_thread_t thread_id;
boolean_t b_die;
boolean_t b_active;
vlc_mutex_t fifos_lock;
aout_fifo_t fifo[ AOUT_MAX_FIFOS ];
......
......@@ -47,6 +47,8 @@
#define COPYRIGHT_MESSAGE "VideoLAN Client - version @VLC_VERSION@" \
" @VLC_CODENAME@ - (c)1996-2000 VideoLAN"
#define VERSION "@VLC_VERSION@"
/*****************************************************************************
* General compilation options
*****************************************************************************/
......@@ -132,6 +134,9 @@
#define INTF_GAMMA_STEP .1
#define INTF_GAMMA_LIMIT 3
/* Maximum number of channels */
#define INTF_MAX_CHANNELS 10
/*
* X11 settings
*/
......
......@@ -63,6 +63,8 @@ typedef struct intf_thread_s
intf_sys_manage_t * p_sys_manage; /* main loop */
intf_sys_destroy_t * p_sys_destroy; /* destroy interface */
/* XXX: Channels array - new API */
//p_intf_channel_t * p_channel[INTF_MAX_CHANNELS];/* channel descriptions */
/* Channels array - NULL if not used */
p_intf_channel_t p_channel; /* description of channels */
......
......@@ -150,10 +150,11 @@ static __inline__ int vlc_thread_create( vlc_thread_t *p_thread,
{
#if defined(HAVE_CTHREADS_H)
*p_thread = cthread_fork( (cthread_fn_t)func, (any_t)p_data );
return( 0 );
return 0;
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
*p_thread = spawn_thread( (thread_func)func, psz_name, B_NORMAL_PRIORITY, p_data );
*p_thread = spawn_thread( (thread_func)func, psz_name,
B_NORMAL_PRIORITY, p_data );
return resume_thread( *p_thread );
#elif defined(HAVE_PTHREAD_H)
......@@ -189,7 +190,7 @@ static __inline__ void vlc_thread_join( vlc_thread_t thread )
cthread_join( thread );
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
int32 exit_value;
int32 exit_value;
wait_for_thread( thread, &exit_value );
#elif defined(HAVE_PTHREAD_H)
......@@ -209,7 +210,10 @@ static __inline__ void lazy_init_mutex(vlc_mutex_t* p_mutex)
}
else /* we're not the first, so wait until the init is finished */
{
while( p_mutex->init != 9999 ) snooze( 10000 );
while( p_mutex->init != 9999 )
{
snooze( 10000 );
}
}
}
#endif
......@@ -221,12 +225,15 @@ static __inline__ int vlc_mutex_init( vlc_mutex_t *p_mutex )
{
#if defined(HAVE_CTHREADS_H)
mutex_init( p_mutex );
return( 0 );
return 0;
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
// check the arguments and whether it's already been initialized
if( !p_mutex ) return B_BAD_VALUE;
if( p_mutex->init == 9999 ) return EALREADY;
if( !p_mutex )
return B_BAD_VALUE;
if( p_mutex->init == 9999 )
return EALREADY;
p_mutex->lock = create_sem( 1, "BeMutex" );
p_mutex->owner = -1;
......@@ -246,17 +253,23 @@ static __inline__ int vlc_mutex_lock( vlc_mutex_t *p_mutex )
{
#if defined(HAVE_CTHREADS_H)
mutex_lock( p_mutex );
return( 0 );
return 0;
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
status_t err;
if( !p_mutex ) return B_BAD_VALUE;
if( p_mutex->init < 2000 ) return B_NO_INIT;
if( !p_mutex )
return B_BAD_VALUE;
if( p_mutex->init < 2000 )
return B_NO_INIT;
lazy_init_mutex( p_mutex );
err = acquire_sem( p_mutex->lock );
if( !err ) p_mutex->owner = find_thread( NULL );
if( !err )
p_mutex->owner = find_thread( NULL );
return err;
#elif defined(HAVE_PTHREAD_H)
......@@ -272,14 +285,20 @@ static __inline__ int vlc_mutex_unlock( vlc_mutex_t *p_mutex )
{
#if defined(HAVE_CTHREADS_H)
mutex_unlock( p_mutex );
return( 0 );
return 0;
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
if(! p_mutex) return B_BAD_VALUE;
if( p_mutex->init < 2000 ) return B_NO_INIT;
if(! p_mutex)
return B_BAD_VALUE;
if( p_mutex->init < 2000 )
return B_NO_INIT;
lazy_init_mutex( p_mutex );
if( p_mutex->owner != find_thread(NULL) ) return ENOLCK;
if( p_mutex->owner != find_thread(NULL) )
return ENOLCK;
p_mutex->owner = -1;
release_sem( p_mutex->lock );
return B_OK;
......@@ -301,7 +320,10 @@ static __inline__ void lazy_init_cond( vlc_cond_t* p_condvar )
}
else /* we're not the first, so wait until the init is finished */
{
while( p_condvar->init != 9999 ) snooze( 10000 );
while( p_condvar->init != 9999 )
{
snooze( 10000 );
}
}
}
#endif
......@@ -318,11 +340,14 @@ static __inline__ int vlc_cond_init( vlc_cond_t *p_condvar )
p_condvar->name = 0;
p_condvar->implications = 0;
return( 0 );
return 0;
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
if( !p_condvar ) return B_BAD_VALUE;
if( p_condvar->init == 9999 ) return EALREADY;
if( !p_condvar )
return B_BAD_VALUE;
if( p_condvar->init == 9999 )
return EALREADY;
p_condvar->sem = create_sem( 0, "CVSem" );
p_condvar->handshakeSem = create_sem( 0, "CVHandshake" );
......@@ -348,24 +373,32 @@ static __inline__ int vlc_cond_signal( vlc_cond_t *p_condvar )
{
cond_signal( (condition_t)p_condvar );
}
return( 0 );
return 0;
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
status_t err = B_OK;
if( !p_condvar ) return B_BAD_VALUE;
if( p_condvar->init < 2000 ) return B_NO_INIT;
if( !p_condvar )
return B_BAD_VALUE;
if( p_condvar->init < 2000 )
return B_NO_INIT;
lazy_init_cond( p_condvar );
if( acquire_sem(p_condvar->signalSem) == B_INTERRUPTED) return B_INTERRUPTED;
if( acquire_sem(p_condvar->signalSem) == B_INTERRUPTED)
return B_INTERRUPTED;
if( p_condvar->nw > p_condvar->ns )
{
p_condvar->ns += 1;
release_sem( p_condvar->sem );
release_sem( p_condvar->signalSem );
while( acquire_sem(p_condvar->handshakeSem) == B_INTERRUPTED )
{ err = B_INTERRUPTED; }
{
err = B_INTERRUPTED;
}
}
else
{
......@@ -386,17 +419,25 @@ static __inline__ int vlc_cond_wait( vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex
{
#if defined(HAVE_CTHREADS_H)
condition_wait( (condition_t)p_condvar, (mutex_t)p_mutex );
return( 0 );
return 0;
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
status_t err;
if( !p_condvar ) return B_BAD_VALUE;
if( !p_mutex ) return B_BAD_VALUE;
if( p_condvar->init < 2000 ) return B_NO_INIT;
if( !p_condvar )
return B_BAD_VALUE;
if( !p_mutex )
return B_BAD_VALUE;
if( p_condvar->init < 2000 )
return B_NO_INIT;
lazy_init_cond( p_condvar );
if( acquire_sem(p_condvar->signalSem) == B_INTERRUPTED ) return B_INTERRUPTED;
if( acquire_sem(p_condvar->signalSem) == B_INTERRUPTED )
return B_INTERRUPTED;
p_condvar->nw += 1;
release_sem( p_condvar->signalSem );
......@@ -404,7 +445,10 @@ static __inline__ int vlc_cond_wait( vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex
err = acquire_sem( p_condvar->sem );
while( acquire_sem(p_condvar->signalSem) == B_INTERRUPTED)
{ err = B_INTERRUPTED; }
{
err = B_INTERRUPTED;
}
if( p_condvar->ns > 0 )
{
release_sem( p_condvar->handshakeSem );
......@@ -414,7 +458,9 @@ static __inline__ int vlc_cond_wait( vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex
release_sem( p_condvar->signalSem );
while( vlc_mutex_lock(p_mutex) == B_INTERRUPTED)
{ err = B_INTERRUPTED; }
{
err = B_INTERRUPTED;
}
return err;
#elif defined(HAVE_PTHREAD_H)
......
......@@ -152,8 +152,6 @@ typedef struct subpicture_s
struct
{
int i_offset[2]; /* byte offsets to data */
int i_x1, i_x2; /* X coordinates */
int i_y1, i_y2; /* Y coordinates */
} spu;
} type;
......
......@@ -34,17 +34,17 @@ static inline u16 max (s16 a, s16 b);
*/
static void ba_compute_psd (s16 start, s16 end, s16 exps[],
s16 psd[], s16 bndpsd[]);
s16 psd[], s16 bndpsd[]);
static void ba_compute_excitation (s16 start, s16 end, s16 fgain,
s16 fastleak, s16 slowleak, s16 is_lfe,
s16 bndpsd[], s16 excite[]);
s16 fastleak, s16 slowleak, s16 is_lfe,
s16 bndpsd[], s16 excite[]);
static void ba_compute_mask (s16 start, s16 end, u16 fscod,
u16 deltbae, u16 deltnseg, u16 deltoffst[],
u16 deltba[], u16 deltlen[], s16 excite[],
s16 mask[]);
u16 deltbae, u16 deltnseg, u16 deltoffst[],
u16 deltba[], u16 deltlen[], s16 excite[],
s16 mask[]);
static void ba_compute_bap (s16 start, s16 end, s16 snroffset,
s16 psd[], s16 mask[], s16 bap[]);
s16 psd[], s16 mask[], s16 bap[]);
/* Misc LUTs for bit allocation process */
......@@ -57,16 +57,16 @@ static u16 floortab[] = { 0x2f0, 0x2b0, 0x270, 0x230, 0x1f0, 0x170, 0x0f0, 0xf80
static s16 fastgain[] = { 0x080, 0x100, 0x180, 0x200, 0x280, 0x300, 0x380, 0x400 };
static s16 bndtab[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 31,
34, 37, 40, 43, 46, 49, 55, 61, 67, 73,
79, 85, 97, 109, 121, 133, 157, 181, 205, 229 };
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 31,
34, 37, 40, 43, 46, 49, 55, 61, 67, 73,
79, 85, 97, 109, 121, 133, 157, 181, 205, 229 };
static s16 bndsz[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 3, 3,
3, 3, 3, 3, 3, 6, 6, 6, 6, 6,
6, 12, 12, 12, 12, 24, 24, 24, 24, 24 };
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 3, 3,
3, 3, 3, 3, 3, 6, 6, 6, 6, 6,
6, 12, 12, 12, 12, 24, 24, 24, 24, 24 };
static s16 masktab[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 28, 28, 29,
......@@ -212,10 +212,10 @@ void bit_allocate (ac3dec_t * p_ac3dec)
/* Only perform bit_allocation if the exponents have changed or we
* have new sideband information */
if (p_ac3dec->audblk.chexpstr[0] == 0 && p_ac3dec->audblk.chexpstr[1] == 0 &&
p_ac3dec->audblk.chexpstr[2] == 0 && p_ac3dec->audblk.chexpstr[3] == 0 &&
p_ac3dec->audblk.chexpstr[4] == 0 && p_ac3dec->audblk.cplexpstr == 0 &&
p_ac3dec->audblk.lfeexpstr == 0 && p_ac3dec->audblk.baie == 0 &&
p_ac3dec->audblk.snroffste == 0 && p_ac3dec->audblk.deltbaie == 0)
p_ac3dec->audblk.chexpstr[2] == 0 && p_ac3dec->audblk.chexpstr[3] == 0 &&
p_ac3dec->audblk.chexpstr[4] == 0 && p_ac3dec->audblk.cplexpstr == 0 &&
p_ac3dec->audblk.lfeexpstr == 0 && p_ac3dec->audblk.baie == 0 &&
p_ac3dec->audblk.snroffste == 0 && p_ac3dec->audblk.deltbaie == 0)
return;
/* Do some setup before we do the bit alloc */
......@@ -227,9 +227,9 @@ void bit_allocate (ac3dec_t * p_ac3dec)
/* if all the SNR offset constants are zero then the whole block is zero */
if (!p_ac3dec->audblk.csnroffst && !p_ac3dec->audblk.fsnroffst[0] &&
!p_ac3dec->audblk.fsnroffst[1] && !p_ac3dec->audblk.fsnroffst[2] &&
!p_ac3dec->audblk.fsnroffst[3] && !p_ac3dec->audblk.fsnroffst[4] &&
!p_ac3dec->audblk.cplfsnroffst && !p_ac3dec->audblk.lfefsnroffst) {
!p_ac3dec->audblk.fsnroffst[1] && !p_ac3dec->audblk.fsnroffst[2] &&
!p_ac3dec->audblk.fsnroffst[3] && !p_ac3dec->audblk.fsnroffst[4] &&
!p_ac3dec->audblk.cplfsnroffst && !p_ac3dec->audblk.lfefsnroffst) {
memset(p_ac3dec->audblk.fbw_bap,0,sizeof(u16) * 256 * 5);
memset(p_ac3dec->audblk.cpl_bap,0,sizeof(u16) * 256);
memset(p_ac3dec->audblk.lfe_bap,0,sizeof(u16) * 7);
......@@ -247,17 +247,17 @@ void bit_allocate (ac3dec_t * p_ac3dec)
ba_compute_psd (start, end, p_ac3dec->audblk.fbw_exp[i], psd, bndpsd);
ba_compute_excitation (start, end , fgain, fastleak, slowleak, 0,
bndpsd, excite);
bndpsd, excite);
ba_compute_mask (start, end, p_ac3dec->syncinfo.fscod,
p_ac3dec->audblk.deltbae[i],
p_ac3dec->audblk.deltnseg[i],
p_ac3dec->audblk.deltoffst[i],
p_ac3dec->audblk.deltba[i],
p_ac3dec->audblk.deltlen[i], excite, mask);
p_ac3dec->audblk.deltbae[i],
p_ac3dec->audblk.deltnseg[i],
p_ac3dec->audblk.deltoffst[i],
p_ac3dec->audblk.deltba[i],
p_ac3dec->audblk.deltlen[i], excite, mask);
ba_compute_bap (start, end, snroffset, psd, mask,
p_ac3dec->audblk.fbw_bap[i]);
p_ac3dec->audblk.fbw_bap[i]);
}
if (p_ac3dec->audblk.cplinu) {
......@@ -271,17 +271,17 @@ void bit_allocate (ac3dec_t * p_ac3dec)
ba_compute_psd (start, end, p_ac3dec->audblk.cpl_exp, psd, bndpsd);
ba_compute_excitation (start, end , fgain, fastleak, slowleak, 0,
bndpsd, excite);
bndpsd, excite);
ba_compute_mask (start, end, p_ac3dec->syncinfo.fscod,
p_ac3dec->audblk.cpldeltbae,
p_ac3dec->audblk.cpldeltnseg,
p_ac3dec->audblk.cpldeltoffst,
p_ac3dec->audblk.cpldeltba,
p_ac3dec->audblk.cpldeltlen, excite, mask);
p_ac3dec->audblk.cpldeltbae,
p_ac3dec->audblk.cpldeltnseg,
p_ac3dec->audblk.cpldeltoffst,
p_ac3dec->audblk.cpldeltba,
p_ac3dec->audblk.cpldeltlen, excite, mask);
ba_compute_bap (start, end, snroffset, psd, mask,
p_ac3dec->audblk.cpl_bap);
p_ac3dec->audblk.cpl_bap);
}
if (p_ac3dec->bsi.lfeon) {
......@@ -295,19 +295,19 @@ void bit_allocate (ac3dec_t * p_ac3dec)
ba_compute_psd (start, end, p_ac3dec->audblk.lfe_exp, psd, bndpsd);
ba_compute_excitation (start, end , fgain, fastleak, slowleak, 1,
bndpsd, excite);
bndpsd, excite);
ba_compute_mask (start, end, p_ac3dec->syncinfo.fscod, 2, 0, 0, 0, 0,
excite, mask);
excite, mask);
ba_compute_bap (start, end, snroffset, psd, mask,
p_ac3dec->audblk.lfe_bap);
p_ac3dec->audblk.lfe_bap);
}
}
static void ba_compute_psd (s16 start, s16 end, s16 exps[], s16 psd[],
s16 bndpsd[])
s16 bndpsd[])
{
int bin,i,j,k;
s16 lastbin = 0;
......@@ -336,8 +336,8 @@ static void ba_compute_psd (s16 start, s16 end, s16 exps[], s16 psd[],
}
static void ba_compute_excitation (s16 start, s16 end,s16 fgain, s16 fastleak,
s16 slowleak, s16 is_lfe, s16 bndpsd[],
s16 excite[])
s16 slowleak, s16 is_lfe, s16 bndpsd[],
s16 excite[])
{
int bin;
s16 bndstrt;
......@@ -360,9 +360,9 @@ static void ba_compute_excitation (s16 start, s16 end,s16 fgain, s16 fastleak,
for (bin = 2; bin < 7; bin++) {
if (!(is_lfe && (bin == 6)))
lowcomp = calc_lowcomp (lowcomp, bndpsd[bin], bndpsd[bin+1], bin);
fastleak = bndpsd[bin] - fgain;
slowleak = bndpsd[bin] - sgain;
excite[bin] = fastleak - lowcomp;
fastleak = bndpsd[bin] - fgain;
slowleak = bndpsd[bin] - sgain;
excite[bin] = fastleak - lowcomp;
if (!(is_lfe && (bin == 6))) {
if (bndpsd[bin] <= bndpsd[bin+1]) {
......@@ -375,11 +375,11 @@ static void ba_compute_excitation (s16 start, s16 end,s16 fgain, s16 fastleak,
for (bin = begin; bin < min(bndend, 22); bin++) {
if (!(is_lfe && (bin == 6)))
lowcomp = calc_lowcomp (lowcomp, bndpsd[bin], bndpsd[bin+1], bin);
fastleak -= fdecay ;
fastleak = max(fastleak, bndpsd[bin] - fgain);
slowleak -= sdecay ;
slowleak = max(slowleak, bndpsd[bin] - sgain);
excite[bin] = max(fastleak - lowcomp, slowleak);
fastleak -= fdecay ;
fastleak = max(fastleak, bndpsd[bin] - fgain);
slowleak -= sdecay ;
slowleak = max(slowleak, bndpsd[bin] - sgain);
excite[bin] = max(fastleak - lowcomp, slowleak);
}
begin = 22;
} else { /* For coupling channel */
......@@ -396,8 +396,8 @@ static void ba_compute_excitation (s16 start, s16 end,s16 fgain, s16 fastleak,
}
static void ba_compute_mask (s16 start, s16 end, u16 fscod, u16 deltbae,
u16 deltnseg, u16 deltoffst[], u16 deltba[],
u16 deltlen[], s16 excite[], s16 mask[])
u16 deltnseg, u16 deltoffst[], u16 deltba[],
u16 deltlen[], s16 excite[], s16 mask[])
{
int bin,k;
s16 bndstrt;
......@@ -428,15 +428,15 @@ static void ba_compute_mask (s16 start, s16 end, u16 fscod, u16 deltbae,
delta = (deltba[seg] - 4) << 7;
}
for (k = 0; k < deltlen[seg]; k++) {
mask[band] += delta;
band++;
mask[band] += delta;
band++;
}
}
}
}
static void ba_compute_bap (s16 start, s16 end, s16 snroffset, s16 psd[],
s16 mask[], s16 bap[])
s16 mask[], s16 bap[])
{
int i,j,k;
s16 lastbin = 0;
......
......@@ -39,21 +39,21 @@ int ac3_decode_frame (ac3dec_t * p_ac3dec, s16 * buffer)
int i;
if (parse_bsi (p_ac3dec))
return 1;
return 1;
for (i = 0; i < 6; i++) {
if (parse_audblk (p_ac3dec, i))
return 1;
if (exponent_unpack (p_ac3dec))
return 1;
bit_allocate (p_ac3dec);
mantissa_unpack (p_ac3dec);
if (p_ac3dec->bsi.acmod == 0x2)
rematrix (p_ac3dec);
imdct (p_ac3dec);
downmix (p_ac3dec, buffer);
buffer += 2*256;
if (parse_audblk (p_ac3dec, i))
return 1;
if (exponent_unpack (p_ac3dec))
return 1;
bit_allocate (p_ac3dec);
mantissa_unpack (p_ac3dec);
if (p_ac3dec->bsi.acmod == 0x2)
rematrix (p_ac3dec);
imdct (p_ac3dec);
downmix (p_ac3dec, buffer);
buffer += 2*256;
}
parse_auxdata (p_ac3dec);
......
......@@ -185,9 +185,9 @@ static int InitThread (adec_thread_t * p_adec)
p_adec->p_ts = DECODER_FIFO_START ( p_adec->fifo )->p_first_ts;
byte_stream = adec_byte_stream ( &p_adec->audio_decoder );
byte_stream->p_byte =
p_adec->p_ts->buffer + p_adec->p_ts->i_payload_start;
p_adec->p_ts->buffer + p_adec->p_ts->i_payload_start;
byte_stream->p_end =
p_adec->p_ts->buffer + p_adec->p_ts->i_payload_end;
p_adec->p_ts->buffer + p_adec->p_ts->i_payload_end;
byte_stream->info = p_adec;
vlc_mutex_unlock ( &p_adec->fifo.data_lock );
......@@ -235,7 +235,7 @@ static void RunThread (adec_thread_t * p_adec)
adec_sync_info_t sync_info;
if ( !sync )
{
{
/* have to find a synchro point */
adec_byte_stream_t * p_byte_stream;
......@@ -246,32 +246,36 @@ static void RunThread (adec_thread_t * p_adec)
do
{
adec_byte_stream_next ( p_byte_stream );
} while ( (!p_adec->align) && (!p_adec->b_die) && (!p_adec->b_error) );
} while ( 0 && (!p_adec->align) && (!p_adec->b_die)
&& (!p_adec->b_error) );
sync = 1;
}
sync = 1;
}
if( DECODER_FIFO_START( p_adec->fifo)->b_has_pts )
{
p_adec->p_aout_fifo->date[p_adec->p_aout_fifo->l_end_frame] = DECODER_FIFO_START( p_adec->fifo )->i_pts;
p_adec->p_aout_fifo->date[p_adec->p_aout_fifo->l_end_frame] =
DECODER_FIFO_START( p_adec->fifo )->i_pts;
DECODER_FIFO_START(p_adec->fifo)->b_has_pts = 0;
}
else
{
p_adec->p_aout_fifo->date[p_adec->p_aout_fifo->l_end_frame] = LAST_MDATE;
}
p_adec->p_aout_fifo->date[p_adec->p_aout_fifo->l_end_frame] =
LAST_MDATE;
}
if( adec_sync_frame (&p_adec->audio_decoder, &sync_info) )
{
sync = 0;
goto bad_frame;
}
}
p_adec->p_aout_fifo->l_rate = sync_info.sample_rate;
buffer = ((s16 *)p_adec->p_aout_fifo->buffer) + (p_adec->p_aout_fifo->l_end_frame * ADEC_FRAME_SIZE);
buffer = ((s16 *)p_adec->p_aout_fifo->buffer)
+ (p_adec->p_aout_fifo->l_end_frame * ADEC_FRAME_SIZE);
if( adec_decode_frame (&p_adec->audio_decoder, buffer) )
if( adec_decode_frame (&p_adec->audio_decoder, buffer) )
{
sync = 0;
goto bad_frame;
......@@ -279,7 +283,8 @@ static void RunThread (adec_thread_t * p_adec)
vlc_mutex_lock (&p_adec->p_aout_fifo->data_lock);
p_adec->p_aout_fifo->l_end_frame = (p_adec->p_aout_fifo->l_end_frame + 1) & AOUT_FIFO_SIZE;
p_adec->p_aout_fifo->l_end_frame =
(p_adec->p_aout_fifo->l_end_frame + 1) & AOUT_FIFO_SIZE;
vlc_cond_signal (&p_adec->p_aout_fifo->data_wait);
vlc_mutex_unlock (&p_adec->p_aout_fifo->data_lock);
......@@ -315,7 +320,8 @@ static void ErrorThread ( adec_thread_t *p_adec )
/* Trash all received PES packets */
while ( !DECODER_FIFO_ISEMPTY(p_adec->fifo) )
{
input_NetlistFreePES ( p_adec->p_input, DECODER_FIFO_START(p_adec->fifo) );
input_NetlistFreePES ( p_adec->p_input,
DECODER_FIFO_START(p_adec->fifo) );
DECODER_FIFO_INCSTART ( p_adec->fifo );
}
......@@ -397,8 +403,10 @@ void adec_byte_stream_next ( adec_byte_stream_t * p_byte_stream )
/* The next byte could be found in the next PES packet */
p_adec->p_ts = DECODER_FIFO_START (p_adec->fifo)->p_first_ts;
if (DECODER_FIFO_START (p_adec->fifo)->b_data_alignment)
p_adec->align = 1;
if (DECODER_FIFO_START (p_adec->fifo)->b_data_alignment)
{
p_adec->align = 1;
}
/* We can release the fifo's data lock */
vlc_mutex_unlock (&p_adec->fifo.data_lock);
......@@ -413,7 +421,7 @@ void adec_byte_stream_next ( adec_byte_stream_t * p_byte_stream )
/* We've found a TS packet which contains interesting data... */
p_byte_stream->p_byte =
p_adec->p_ts->buffer + p_adec->p_ts->i_payload_start;
p_adec->p_ts->buffer + p_adec->p_ts->i_payload_start;
p_byte_stream->p_end =
p_adec->p_ts->buffer + p_adec->p_ts->i_payload_end;
p_adec->p_ts->buffer + p_adec->p_ts->i_payload_end;
}
......@@ -182,6 +182,7 @@ static int aout_SpawnThread( aout_thread_t * p_aout )
/* We want the audio output thread to live */
p_aout->b_die = 0;
p_aout->b_active = 1;
/* Initialize the fifos lock */
vlc_mutex_init( &p_aout->fifos_lock );
......
......@@ -419,10 +419,11 @@ static int LoadChannels( intf_thread_t *p_intf, char *psz_filename )
{
if( !ParseChannel( p_channel, psz_line ) )
{