]> git.sesse.net Git - vlc/commitdiff
Partial fix of the OS X audio output (thanks Heiko!).
authorChristophe Massiot <massiot@videolan.org>
Mon, 18 Nov 2002 23:00:41 +0000 (23:00 +0000)
committerChristophe Massiot <massiot@videolan.org>
Mon, 18 Nov 2002 23:00:41 +0000 (23:00 +0000)
modules/audio_filter/converter/a52tofloat32.c
modules/gui/macosx/aout.m
modules/gui/macosx/vout.m

index dc70e6311f37036df7959dba343785ccf70d840a..c6eb5b3025ba409281b9a073e1e7bc0fa785cbd7 100644 (file)
@@ -4,7 +4,7 @@
  *   (http://liba52.sf.net/).
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: a52tofloat32.c,v 1.6 2002/11/14 22:38:46 massiot Exp $
+ * $Id: a52tofloat32.c,v 1.7 2002/11/18 23:00:41 massiot Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -289,8 +289,9 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
 
         p_samples = a52_samples( p_sys->p_liba52 );
 
-        if ( ((p_sys->i_flags & A52_CHANNEL1) || (p_sys->i_flags & A52_CHANNEL2)
-               || (p_sys->i_flags & A52_MONO))
+        if ( ((p_sys->i_flags & A52_CHANNEL_MASK) == A52_CHANNEL1
+               || (p_sys->i_flags & A52_CHANNEL_MASK) == A52_CHANNEL2
+               || (p_sys->i_flags & A52_CHANNEL_MASK) == A52_MONO)
               && (p_filter->output.i_physical_channels 
                    & (AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT)) )
         {
index 7ffe9d82105c49ef2b4fb43d8591906651f01604..024c7ab92959f2638683b5de9fe9321476769d59 100644 (file)
@@ -2,7 +2,7 @@
  * aout.m: CoreAudio output plugin
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: aout.m,v 1.14 2002/11/14 22:38:48 massiot Exp $
+ * $Id: aout.m,v 1.15 2002/11/18 23:00:41 massiot Exp $
  *
  * Authors: Colin Delacroix <colin@zoy.org>
  *          Jon Lech Johansen <jon-vl@nanocrew.net>
@@ -129,9 +129,13 @@ int E_(OpenAudio)( vlc_object_t * p_this )
     case kAudioFormatLinearPCM:
         p_aout->output.output.i_format = VLC_FOURCC('f','l','3','2');
         if ( p_sys->stream_format.mChannelsPerFrame < 6 )
-            p_aout->output.output.i_channels = AOUT_CHAN_STEREO;
+            p_aout->output.output.i_physical_channels
+                 = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT;
         else
-            p_aout->output.output.i_channels = AOUT_CHAN_3F2R | AOUT_CHAN_LFE;
+            p_aout->output.output.i_physical_channels
+                  = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT
+                  | AOUT_CHAN_CENTER | AOUT_CHAN_REARRIGHT
+                  | AOUT_CHAN_REARLEFT | AOUT_CHAN_LFE;
         break;
 
     case kAudioFormat60958AC3:
@@ -257,7 +261,12 @@ static OSStatus IOCallback( AudioDeviceID inDevice,
                        outOutputData->mBuffers[ 0 ].mData, 
                        p_sys->i_buffer_size );
 
-//     msg_Dbg(p_aout, "This buffer has %d bytes, i take %d", p_buffer->i_nb_bytes, p_sys->i_buffer_size);
+/*     msg_Dbg(p_aout, "This buffer has %d bytes, i take %d: %f %f %f %f",
+        p_buffer->i_nb_bytes, p_sys->i_buffer_size,
+        ((float*)p_buffer->p_buffer)[0], ((float*)p_buffer->p_buffer)[1],
+        ((float*)p_buffer->p_buffer)[2], ((float*)p_buffer->p_buffer)[3]);
+*/
+
     
        aout_BufferFree( p_buffer );
     }
index c896880f5af5377c2b3c5dbe6c0ec8639c86ba17..559f13c4068ab4ce774a203bdeecd69f1e49db5c 100644 (file)
@@ -2,7 +2,7 @@
  * vout.m: MacOS X video output plugin
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: vout.m,v 1.3 2002/10/04 14:02:20 sam Exp $
+ * $Id: vout.m,v 1.4 2002/11/18 23:00:41 massiot Exp $
  *
  * Authors: Colin Delacroix <colin@zoy.org>
  *          Florian G. Pflug <fgp@phlo.org>
@@ -139,6 +139,7 @@ int E_(OpenVideo) ( vlc_object_t *p_this )
         msg_Err( p_vout, "EnterMovies failed: %d", err );
         free( p_vout->p_sys->p_matrix );
         DisposeHandle( (Handle)p_vout->p_sys->h_img_descr );
+        vlc_object_release( p_vout->p_sys->p_intf );
         free( p_vout->p_sys );
         return( 1 );
     } 
@@ -167,6 +168,7 @@ int E_(OpenVideo) ( vlc_object_t *p_this )
     {
         free( p_vout->p_sys->p_matrix );
         DisposeHandle( (Handle)p_vout->p_sys->h_img_descr );
+        vlc_object_release( p_vout->p_sys->p_intf );
         free( p_vout->p_sys );
         return( 1 );        
     }
@@ -176,6 +178,7 @@ int E_(OpenVideo) ( vlc_object_t *p_this )
         msg_Err( p_vout, "unable to create window" );
         free( p_vout->p_sys->p_matrix );
         DisposeHandle( (Handle)p_vout->p_sys->h_img_descr );
+        vlc_object_release( p_vout->p_sys->p_intf );
         free( p_vout->p_sys ); 
         return( 1 );
     }