Commit cefc73ef authored by Jean-Marc Dressler's avatar Jean-Marc Dressler

R�paration de la version BeOS. Le probl�me venait du swab32 de la nouvelle

bit stream, la macro pour la conversion de BIGENDIAN vers LITTLEENDIAN ne
fonctionnant (toujours) pas.

La version BeOS pose encore de gros probl�mes:
- des plantages al�atoires lorsqu'on utilise le son,
- des performances tr�s en dessous de celles d'anciennes version du vlc,
- une synchro son qui ne fonctionne pas correctement,
- au bout d'un certain temps d'utilisation, toutes les ressources syst�mes
  sont consomm�es et le syst�me lui-m�me devient instable (merci d'�viter
  les commentaires sur la stabilit� de BeOS)
parent 454c7eb8
......@@ -188,9 +188,15 @@ static __inline__ void DumpBits32( bit_stream_t * p_bit_stream )
void PeekNextPacket( bit_stream_t * p_bit_stream );
//(stolen from the kernel)
#if __BYTE_ORDER == __BIG_ENDIAN
# define swab32(x) (x)
// XXX: The macro swab32 for little endian machine does
// not seem to work correctly
#if defined(SYS_BEOS)
# define swab32(x) B_BENDIAN_TO_HOST_INT32(x)
#else
# if __BYTE_ORDER == __BIG_ENDIAN
# define swab32(x) (x)
# else
# if defined (__i386__)
# define swab32(x) __i386_swab32(x)
static inline const u32 __i386_swab32(u32 x)
......@@ -200,11 +206,13 @@ static inline const u32 __i386_swab32(u32 x)
}
# else
# define swab32(x)\
((((u8*)&x)[0] << 24) | (((u8*)&x)[1] << 16) | \
(((u8*)&x)[2] << 8) | (((u8*)&x)[3]))
( ( (u32)(((u8*)&x)[0]) << 24 ) | ( (u32)(((u8*)&x)[1]) << 16 ) | \
( (u32)(((u8*)&x)[2]) << 8 ) | ( (u32)(((u8*)&x)[3])) )
# endif
# endif
#endif
static __inline__ WORD_TYPE GetWord( bit_stream_t * p_bit_stream )
{
if( p_bit_stream->p_byte <= p_bit_stream->p_end - WORD_BYTE_LENGTH )
......
......@@ -35,6 +35,7 @@
#undef MIN
#include <kernel/OS.h>
#include <kernel/scheduler.h>
#include <byteorder.h>
#else
#error no threads available on your system !
#endif
......@@ -201,25 +202,6 @@ static __inline__ void vlc_thread_join( vlc_thread_t thread )
#endif
}
#if defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
/* lazy_init_mutex */
static __inline__ void lazy_init_mutex(vlc_mutex_t* p_mutex)
{
int32 v = atomic_or( &p_mutex->init, 1 );
if( 2000 == v ) /* we're the first, so do the init */
{
vlc_mutex_init( p_mutex );
}
else /* we're not the first, so wait until the init is finished */
{
while( p_mutex->init != 9999 )
{
snooze( 10000 );
}
}
}
#endif
/*****************************************************************************
* vlc_mutex_init: initialize a mutex
*****************************************************************************/
......@@ -247,6 +229,25 @@ static __inline__ int vlc_mutex_init( vlc_mutex_t *p_mutex )
#endif
}
#if defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
/* lazy_init_mutex */
static __inline__ void lazy_init_mutex(vlc_mutex_t* p_mutex)
{
int32 v = atomic_or( &p_mutex->init, 1 );
if( 2000 == v ) /* we're the first, so do the init */
{
vlc_mutex_init( p_mutex );
}
else /* we're not the first, so wait until the init is finished */
{
while( p_mutex->init != 9999 )
{
snooze( 10000 );
}
}
}
#endif
/*****************************************************************************
* vlc_mutex_lock: lock a mutex
*****************************************************************************/
......@@ -307,25 +308,6 @@ static __inline__ int vlc_mutex_unlock( vlc_mutex_t *p_mutex )
#endif
}
#if defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
/* lazy_init_cond */
static __inline__ void lazy_init_cond( vlc_cond_t* p_condvar )
{
int32 v = atomic_or( &p_condvar->init, 1 );
if( 2000 == v ) /* we're the first, so do the init */
{
vlc_cond_init( p_condvar );
}
else /* we're not the first, so wait until the init is finished */
{
while( p_condvar->init != 9999 )
{
snooze( 10000 );
}
}
}
#endif
/*****************************************************************************
* vlc_cond_init: initialize a condition
*****************************************************************************/
......@@ -360,6 +342,26 @@ static __inline__ int vlc_cond_init( vlc_cond_t *p_condvar )
#endif
}
#if defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
/* lazy_init_cond */
static __inline__ void lazy_init_cond( vlc_cond_t* p_condvar )
{
int32 v = atomic_or( &p_condvar->init, 1 );
if( 2000 == v ) /* we're the first, so do the init */
{
vlc_cond_init( p_condvar );
}
else /* we're not the first, so wait until the init is finished */
{
while( p_condvar->init != 9999 )
{
snooze( 10000 );
}
}
}
#endif
/*****************************************************************************
* vlc_cond_signal: start a thread on condition completion
*****************************************************************************/
......@@ -466,3 +468,4 @@ static __inline__ int vlc_cond_wait( vlc_cond_t *p_condvar, vlc_mutex_t *p_mutex
#endif
}
......@@ -450,10 +450,10 @@ int vout_BeManage( vout_thread_t *p_vout )
p_vout->p_sys->p_window->ResizeTo( p_vout->i_width, p_vout->i_height );
/* Destroy XImages to change their size */
vout_SysEnd( p_vout );
vout_BeEnd( p_vout );
/* Recreate XImages. If SysInit failed, the thread can't go on. */
if( vout_SysInit( p_vout ) )
if( vout_BeInit( p_vout ) )
{
intf_ErrMsg("error: can't resize display\n");
return( 1 );
......
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