Commit f1d40d7e authored by Christophe Massiot's avatar Christophe Massiot

* Fixed miscellaneous bugs.

* Fixed an endianness issue in S/PDIF.
* Added a walken optimization of float32tos16.
parent 89332ee5
......@@ -2,7 +2,7 @@
* a52tospdif.c : encapsulates A/52 frames into S/PDIF packets
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: a52tospdif.c,v 1.2 2002/08/11 23:26:28 massiot Exp $
* $Id: a52tospdif.c,v 1.3 2002/08/12 22:48:18 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Stphane Borel <stef@via.ecp.fr>
......@@ -77,7 +77,11 @@ static int Create( vlc_object_t *p_this )
static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf )
{
#ifdef WORDS_BIGENDIAN
static const u8 p_sync[6] = { 0xF8, 0x72, 0x4E, 0x1F, 0x00, 0x01 };
#else
static const u8 p_sync[6] = { 0x72, 0xF8, 0x1F, 0x4E, 0x01, 0x00 };
#endif
u16 i_length = p_in_buf->i_nb_samples;
u16 * pi_length;
byte_t * p_in = p_in_buf->p_buffer;
......
......@@ -2,7 +2,7 @@
* float32tos16.c : converter from float32 to signed 16 bits integer
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: float32tos16.c,v 1.2 2002/08/09 23:47:22 massiot Exp $
* $Id: float32tos16.c,v 1.3 2002/08/12 22:48:18 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -89,9 +89,19 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
for ( i = 0; i < p_in_buf->i_nb_samples * p_filter->input.i_channels; i++ )
{
#if 0
/* Slow version */
if ( *p_in >= 1.0 ) *p_out = 32767;
else if ( *p_in < -1.0 ) *p_out = -32768;
else *p_out = *p_in * 32768.0;
#else
/* This is walken's trick based on IEEE float format. */
s32 * p_value = (s32 *)p_in;
*p_in += 384.0;
if ( *p_value > 0x43c07fff ) *p_out = 32767;
else if ( *p_value < 0x43bf8000 ) *p_out = -32768;
else *p_out = *p_value - 0x43c00000;
#endif
p_in++; p_out++;
}
......
......@@ -2,7 +2,7 @@
* ps.c : Program Stream input module for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: ps.c,v 1.3 2002/08/12 22:30:07 sigmunau Exp $
* $Id: ps.c,v 1.4 2002/08/12 22:48:18 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -61,7 +61,7 @@ static int Demux ( input_thread_t * );
*****************************************************************************/
vlc_module_begin();
set_description( _("ISO 13818-1 MPEG Program Stream input") );
set_capability( "demux", 0 );
set_capability( "demux", 1 );
set_callbacks( Activate, Deactivate );
add_shortcut( "ps" );
vlc_module_end();
......
......@@ -2,7 +2,7 @@
* aout.m: CoreAudio output plugin
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: aout.m,v 1.2 2002/08/07 21:36:56 massiot Exp $
* $Id: aout.m,v 1.3 2002/08/12 22:48:18 massiot Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
......@@ -157,7 +157,7 @@ static int SetFormat( aout_instance_t * p_aout )
msg_Dbg( p_aout, "toto : %d", p_sys->i_buffer_size );
#else
p_sys->i_buffer_size = sizeof(float) * p_aout->output.output.i_channels
* 1536;
* 4096;
err = AudioDeviceSetProperty( p_sys->device, 0, 0, false,
kAudioDevicePropertyBufferSize,
i_param_size, &p_sys->i_buffer_size );
......
......@@ -2,7 +2,7 @@
* stream_output.c : stream output module
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: stream_output.c,v 1.1 2002/08/12 22:12:51 massiot Exp $
* $Id: stream_output.c,v 1.2 2002/08/12 22:48:18 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -170,6 +170,8 @@ static int InitInstance( sout_instance_t * p_sout )
module_Unneed( p_sout, p_sout->p_access );
return -1;
}
return 0;
}
......
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