]> git.sesse.net Git - vlc/commitdiff
* Fixed miscellaneous bugs.
authorChristophe Massiot <massiot@videolan.org>
Mon, 12 Aug 2002 22:48:18 +0000 (22:48 +0000)
committerChristophe Massiot <massiot@videolan.org>
Mon, 12 Aug 2002 22:48:18 +0000 (22:48 +0000)
* Fixed an endianness issue in S/PDIF.
* Added a walken optimization of float32tos16.

modules/audio_filter/converter/a52tospdif.c
modules/audio_filter/converter/float32tos16.c
modules/demux/mpeg/ps.c
modules/gui/macosx/aout.m
src/stream_output/stream_output.c

index 74d9013637d65e6460daff234e92775ca15f7cfe..b031f0f9cdc054dee3f4829b01e95a56e1f6b111 100644 (file)
@@ -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>
  *          Stéphane 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;
index 8ee754ff4a0a5c33f4c073f6cb6bf27b9a38a734..e2f701afc93558de161c6f39fea0f6f024a10397 100644 (file)
@@ -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++;
     }
 
index 0c2aa1c018e5257f1a2877cc1869ff8c8f98fe2d..8877aeab62db84882d259b423344374a15237513 100644 (file)
@@ -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();
index 4d11cdb329582361c2f3e7f30a3162e036c96abf..bb586781ba7fba836cae4cd857f25219dab8f265 100644 (file)
@@ -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 );
index 38a807751ad33b6d9ce9df21878c43e8fca7476b..c186379fe44cf680e3a0b6af4c6e42ec6f73bc1d 100644 (file)
@@ -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;
 }