Commit 4f551c2b authored by Sam Hocevar's avatar Sam Hocevar

  * Header cleaning: filled all empty authors fields, added CVS $Id stuff.
  * Fixes to aout_darwin.c by Colin Delacroix <colin@zoy.org>.
  * Fixes to configure.in, Makefile.in and main.c (Altivec detection)
    by Eugenio Jarosiewicz <ej0@cise.ufl.edu>.
  * Added Colin and Eugenio to the AUTHORS file.
parent c0d2635e
......@@ -30,6 +30,10 @@ N: Renaud Dartus
E: reno@via.ecp.fr
D: AC3 decoder
N: Colin Delacroix
E: colin@zoy.org
D: MacOS X sound support
N: Jean-Marc Dressler
E: polux@via.ecp.fr
D: BeOS port
......@@ -62,6 +66,10 @@ D: playlist and modules system
D: Gnome and Gtk+ interfaces, Glide and fb video outputs, Esound audio output
D: DVD subtitles decoder
N: Eugenio Jarosiewicz
E: ej0@cise.ufl.edu
D: MacOS X interface and fixes
N: Brieuc Jeunhomme
E: bbp@via.ecp.fr
D: Bug fixes
......
......@@ -96,7 +96,7 @@ LIB += -ldl -lsocket -lnsl -lpthread
endif
ifneq (,$(findstring darwin,$(SYS)))
LIB += -ldl -framework Carbon
LIB += -ldl
endif
ifeq ($(SYS),beos)
......@@ -717,7 +717,7 @@ lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT) $(PLUGIN_IDCTCOMMON)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
lib/idctaltivec.so: $(PLUGIN_IDCTALTIVEC) $(PLUGIN_IDCTCOMMON)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -framework VecLib
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -framework vecLib
lib/kde.so: $(PLUGIN_KDE)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -lkdeui -lkdecore -lqt -ldl
......
......@@ -20,7 +20,7 @@ ac_help="$ac_help
ac_help="$ac_help
--disable-mmx Disable MMX optimizations (default enabled for x86)"
ac_help="$ac_help
--enable-activec Enable altivec optimizations (default enabled for PPC)"
--enable-altivec Enable altivec optimizations (default enabled for PPC)"
ac_help="$ac_help
--disable-css Disable DVD CSS decryption (default enabled)"
ac_help="$ac_help
......
......@@ -130,7 +130,7 @@ AC_ARG_ENABLE(mmx,
[ if test x$enableval = xyes; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}${ACCEL_PLUGINS}; fi ],
[ if test x${host_cpu} = xi686 -o x${host_cpu} = xi586 -o x${host_cpu} = xx86; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}${ACCEL_PLUGINS}; fi ])
AC_ARG_ENABLE(altivec,
[ --enable-activec Enable altivec optimizations (default enabled for PPC)],
[ --enable-altivec Enable altivec optimizations (default enabled for PPC)],
[ if test x$enableval = xyes; then ARCH=${ARCH}" altivec"; PLUGINS=${PLUGINS}"idctaltivec "; fi ],
[ if test -d /System/Library/Frameworks/vecLib.framework; then ARCH=${ARCH}" altivec"; PLUGINS=${PLUGINS}"idctaltivec "; fi ])
AC_ARG_ENABLE(css,
......
......@@ -2,9 +2,9 @@
* audio_output.h : audio output thread interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: audio_output.h,v 1.31 2001/03/21 13:42:33 sam Exp $
*
* Authors:
* Michel Kaempf <maxx@via.ecp.fr>
* Authors: Michel Kaempf <maxx@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
......@@ -2,9 +2,9 @@
* beos_init.h: Initialization for BeOS specific features
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: beos_specific.h,v 1.4 2001/03/21 13:42:33 sam Exp $
*
* Authors:
* Jean-Marc Dressler
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
......@@ -3,6 +3,7 @@
* Stand alone file
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: debug.h,v 1.8 2001/03/21 13:42:33 sam Exp $
*
* Authors: Benoît Steiner <benny@via.ecp.fr>
*
......
......@@ -2,6 +2,7 @@
* int_types.h: internal types
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: int_types.h,v 1.6 2001/03/21 13:42:33 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......
......@@ -4,8 +4,9 @@
* interface, such as message output.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: interface.h,v 1.22 2001/03/21 13:42:33 sam Exp $
*
* Authors:
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
......@@ -4,8 +4,9 @@
* interface, such as message output. See config.h for output configuration.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_msg.h,v 1.11 2001/03/21 13:42:33 sam Exp $
*
* Authors:
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
......@@ -2,6 +2,7 @@
* intf_playlist.h : Playlist functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_playlist.h,v 1.2 2001/03/21 13:42:33 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......
......@@ -3,6 +3,7 @@
* Declaration and extern access to global program object.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: main.h,v 1.14 2001/03/21 13:42:33 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......
......@@ -2,6 +2,7 @@
* modules.h : Module management functions.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: modules.h,v 1.19 2001/03/21 13:42:33 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......
......@@ -2,6 +2,7 @@
* modules_core.h : Module management functions used by the core application.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: modules_core.h,v 1.5 2001/03/21 13:42:33 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......
......@@ -2,6 +2,7 @@
* modules_inner.h : Macros used from within a module.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: modules_inner.h,v 1.6 2001/03/21 13:42:33 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......
......@@ -3,9 +3,9 @@
* and TS system layers
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: mpeg_system.h,v 1.2 2001/02/21 04:38:59 henri Exp $
* $Id: mpeg_system.h,v 1.3 2001/03/21 13:42:33 sam Exp $
*
* Authors:
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
......@@ -9,6 +9,7 @@
* Functions prototyped are implemented in interface/mtime.c.
*****************************************************************************
* Copyright (C) 1996, 1997, 1998, 1999, 2000 VideoLAN
* $Id: mtime.h,v 1.7 2001/03/21 13:42:33 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......
......@@ -4,6 +4,7 @@
* modules.
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: netutils.h,v 1.9 2001/03/21 13:42:33 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Henri Fallon <henri@videolan.org>
......
......@@ -4,6 +4,7 @@
* can be anything, including pictures, audio streams, and so on.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: rsc_files.h,v 1.7 2001/03/21 13:42:33 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......
......@@ -2,6 +2,7 @@
* tests.h: several test functions needed by the plugins
*****************************************************************************
* Copyright (C) 1996, 1997, 1998, 1999, 2000 VideoLAN
* $Id: tests.h,v 1.9 2001/03/21 13:42:33 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......
......@@ -3,6 +3,7 @@
* This header provides a portable threads implementation.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: threads.h,v 1.16 2001/03/21 13:42:33 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
......
......@@ -4,6 +4,7 @@
* includes all common video types and constants.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video.h,v 1.29 2001/03/21 13:42:33 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......
......@@ -5,6 +5,7 @@
* thread, and destroy a previously oppenned video output thread.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_output.h,v 1.57 2001/03/21 13:42:33 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......
......@@ -2,9 +2,9 @@
* alsa.c : alsa plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: alsa.c,v 1.8 2001/03/21 13:42:33 sam Exp $
*
* Authors:
* Henri Fallon <henri@videolan.org>
* Authors: Henri Fallon <henri@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
......@@ -2,9 +2,9 @@
* aout_alsa.c : Alsa functions library
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: aout_alsa.c,v 1.12 2001/03/21 13:42:33 sam Exp $
*
* Authors:
* Henri Fallon <henri@videolan.org>
* Authors: Henri Fallon <henri@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
......@@ -2,9 +2,9 @@
* Bitmaps.h
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: Bitmaps.h,v 1.4 2001/03/21 13:42:33 sam Exp $
*
* Authors:
* Tony Castley <tcastley@mail.powerup.com.au>
* Authors: Tony Castley <tcastley@mail.powerup.com.au>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
......@@ -2,8 +2,9 @@
* DrawingTidbits.cpp
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: DrawingTidbits.cpp,v 1.2 2001/03/21 13:42:33 sam Exp $
*
* Authors:
* Authors: Tony Castley <tcastley@mail.powerup.com.au>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
......@@ -2,8 +2,9 @@
* DrawingTidbits.h
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: DrawingTidbits.h,v 1.2 2001/03/21 13:42:33 sam Exp $
*
* Authors:
* Authors: Tony Castley <tcastley@mail.powerup.com.au>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
......@@ -2,6 +2,7 @@
* InterfaceWindow.h: BeOS interface window class prototype
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: InterfaceWindow.h,v 1.8 2001/03/21 13:42:33 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Tony Castley <tcastley@mail.powerup.com.au>
......
......@@ -2,9 +2,9 @@
* MsgVals.h
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: MsgVals.h,v 1.4 2001/03/21 13:42:33 sam Exp $
*
* Authors:
* Tony Castley <tcastley@mail.powerup.com.au>
* Authors: Tony Castley <tcastley@mail.powerup.com.au>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
......@@ -2,9 +2,9 @@
* TransportButton.cpp
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: TransportButton.cpp,v 1.3 2001/03/21 13:42:33 sam Exp $
*
* Authors:
* Tony Castley <tcastley@mail.powerup.com.au>
* Authors: Tony Castley <tcastley@mail.powerup.com.au>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
......@@ -2,9 +2,9 @@
* TransportButton.h
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: TransportButton.h,v 1.3 2001/03/21 13:42:33 sam Exp $
*
* Authors:
* Tony Castley <tcastley@mail.powerup.com.au>
* Authors: Tony Castley <tcastley@mail.powerup.com.au>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
......@@ -2,6 +2,7 @@
* VideoWindow.h: BeOS video window class prototype
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: VideoWindow.h,v 1.4 2001/03/21 13:42:33 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Tony Castley <tcastley@mail.powerup.com.au>
......
......@@ -2,6 +2,7 @@
* beos.cpp : BeOS plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: beos.cpp,v 1.9 2001/03/21 13:42:33 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......
......@@ -2,6 +2,7 @@
* vout_beos.cpp: beos video output display method
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: vout_beos.cpp,v 1.22 2001/03/21 13:42:33 sam Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......
......@@ -2,8 +2,9 @@
* aout_darwin.c : Darwin audio output plugin
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: aout_darwin.c,v 1.3 2001/03/21 13:42:33 sam Exp $
*
* Authors:
* Authors: Colin Delacroix <colin@zoy.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -20,6 +21,19 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*
* 2001/03/21
* Status of audio under Darwin
* It currently works with 16 bits signed big endian mpeg 1 audio
* (and probably mpeg 2). This is the most common case.
* Note: ac3 decoder is currently broken under Darwin
*
* TODO:
* Find little endian files and adapt output
* Find unsigned files and adapt output
* Find 8 bits files and adapt output
*/
#define MODULE_NAME darwin
#include "modules_inner.h"
......@@ -46,6 +60,10 @@
#include <sys/fcntl.h>
/*
* Debug: to dump the output of the decoder directly to a file
* May disappear when AC3 decoder will work on Darwin
*/
#define WRITE_AUDIO_OUTPUT_TO_FILE 0
/*****************************************************************************
......@@ -57,16 +75,14 @@
typedef struct aout_sys_s
{
#if WRITE_AUDIO_OUTPUT_TO_FILE
int fd; // debug
int fd; // debug: fd to dump audio
#endif
// unsigned long sizeOfDataInMemory; // size in bytes of the 32 bit float data stored in memory
Ptr p_Data; // Ptr to the 32 bit float data stored in memory
// Ptr currentDataLocationPtr; // location of the next chunk of data to send to the HAL
AudioDeviceID device; // the default device
UInt32 ui_deviceBufferSize; // bufferSize returned by kAudioDevicePropertyBufferSize
AudioStreamBasicDescription deviceFormat; // info about the default device
vlc_mutex_t mutex_lock;
vlc_cond_t cond_sync;
AudioDeviceID device; // the default device
Ptr p_Data; // ptr to the 32 bit float data
UInt32 ui_deviceBufferSize; // audio device buffer size
vlc_mutex_t mutex_lock; // pthread locks for sync of
vlc_cond_t cond_sync; // aout_Play and callback
} aout_sys_t;
/*****************************************************************************
......@@ -80,13 +96,18 @@ static void aout_Play ( aout_thread_t *p_aout,
byte_t *buffer, int i_size );
static void aout_Close ( aout_thread_t *p_aout );
OSStatus appIOProc( AudioDeviceID inDevice, const AudioTimeStamp* inNow,
const void* inInputData, const AudioTimeStamp* inInputTime,
AudioBufferList* outOutputData, const AudioTimeStamp* inOutputTime,
void* appGlobals );
void Convert16BitIntegerTo32Float( Ptr in16BitDataPtr, Ptr out32BitDataPtr, UInt32 totalBytes );
void Convert16BitIntegerTo32FloatWithByteSwap( Ptr in16BitDataPtr, Ptr out32BitDataPtr, UInt32 totalBytes );
void Convert8BitIntegerTo32Float( Ptr in8BitDataPtr, Ptr out32BitDataPtr, UInt32 totalBytes );
OSStatus appIOProc( AudioDeviceID inDevice, const AudioTimeStamp* inNow,
const void* inInputData, const AudioTimeStamp* inInputTime,
AudioBufferList* outOutputData,
const AudioTimeStamp* inOutputTime,
void* threadGlobals );
void Convert16BitIntegerTo32Float( Ptr p_in16BitDataPtr, Ptr p_out32BitDataPtr,
UInt32 ui_totalBytes );
void Convert16BitIntegerTo32FloatWithByteSwap( Ptr p_in16BitDataPtr,
Ptr p_out32BitDataPtr,
UInt32 p_totalBytes );
void Convert8BitIntegerTo32Float( Ptr in8BitDataPtr, Ptr p_out32BitDataPtr,
UInt32 ui_totalBytes );
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
......@@ -122,7 +143,7 @@ static int aout_Probe( probedata_t *p_data )
static int aout_Open( aout_thread_t *p_aout )
{
OSStatus err = noErr;
UInt32 count, bufferSize;
UInt32 ui_paramSize, ui_bufferSize;
AudioDeviceID device = kAudioDeviceUnknown;
AudioStreamBasicDescription format;
......@@ -135,66 +156,76 @@ static int aout_Open( aout_thread_t *p_aout )
}
/* Initialize some variables */
p_aout->i_format = AOUT_FORMAT_DEFAULT;
p_aout->i_channels = 1 + main_GetIntVariable( AOUT_STEREO_VAR,
p_aout->i_format = AOUT_FORMAT_DEFAULT;
p_aout->i_channels = 1 + main_GetIntVariable( AOUT_STEREO_VAR,
AOUT_STEREO_DEFAULT );
p_aout->l_rate = main_GetIntVariable( AOUT_RATE_VAR,
p_aout->l_rate = main_GetIntVariable( AOUT_RATE_VAR,
AOUT_RATE_DEFAULT );
p_aout->p_sys->device = kAudioDeviceUnknown;
p_aout->p_sys->p_Data = nil;
// p_aout->p_sys->currentDataLocationPtr = nil;
p_aout->p_sys->device = kAudioDeviceUnknown;
p_aout->p_sys->p_Data = nil;
/*
* get the default output device for the HAL
* it is required to pass the size of the data to be returned
*/
ui_paramSize = sizeof( p_aout->p_sys->device );
err = AudioHardwareGetProperty( kAudioHardwarePropertyDefaultOutputDevice,
&ui_paramSize, (void *) &device );
// get the default output device for the HAL
// it is required to pass the size of the data to be returned
count = sizeof( p_aout->p_sys->device );
err = AudioHardwareGetProperty( kAudioHardwarePropertyDefaultOutputDevice,
&count, (void *) &device);
if( err == noErr)
{
// get the buffersize that the default device uses for IO
// it is required to pass the size of the data to be returned
count = sizeof(p_aout->p_sys->ui_deviceBufferSize);
/*
* The values we get here are not used. We may find another method for
* insuring us that the audio device is working !
*
* First get the buffersize that the default device uses for IO
*/
ui_paramSize = sizeof( p_aout->p_sys->ui_deviceBufferSize );
err = AudioDeviceGetProperty( device, 0, false,
kAudioDevicePropertyBufferSize,
&count, &bufferSize);
&ui_paramSize, &ui_bufferSize);
if( err == noErr )
{
// get a description of the data format used by the default device
// it is required to pass the size of the data to be returned
count = sizeof(p_aout->p_sys->deviceFormat);
/* get a description of the data format used by the default device */
ui_paramSize = sizeof(p_aout->p_sys->deviceFormat);
err = AudioDeviceGetProperty( device, 0, false,
kAudioDevicePropertyStreamFormat,
&count, &format);
&ui_paramSize, &format);
if( err == noErr )
{
if( format.mFormatID != kAudioFormatLinearPCM ) return paramErr;
// everything is ok so fill in p_sys
p_aout->p_sys->device = device;
p_aout->p_sys->ui_deviceBufferSize = bufferSize;
p_aout->p_sys->deviceFormat = format;
/* everything is ok so fill in p_sys */
p_aout->p_sys->device = device;
p_aout->p_sys->ui_deviceBufferSize = ui_bufferSize;
p_aout->p_sys->deviceFormat = format;
}
}
}
if (err != noErr) return err;
p_aout->p_sys->ui_deviceBufferSize = 2 * 2 * sizeof(s16)
* ((s64)p_aout->l_rate * AOUT_BUFFER_DURATION) / 1000000;
// p_aout->p_sys->sizeOfDataInMemory = p_aout->p_sys->ui_deviceBufferSize;
/*
* Size calcul taken from audio_output.c we may change that file so we would
* not be forced to compute the same value twice
*/
p_aout->p_sys->ui_deviceBufferSize =
2 * 2 * sizeof(s16) * ((s64)p_aout->l_rate * AOUT_BUFFER_DURATION) / 1000000;
/* Allocate memory for audio */
p_aout->p_sys->p_Data = NewPtrClear( p_aout->p_sys->ui_deviceBufferSize );
if( p_aout->p_sys->p_Data == nil ) return paramErr;
#if WRITE_AUDIO_OUTPUT_TO_FILE
p_aout->p_sys->fd = open( "/Users/bofh/audio-darwin.pcm", O_RDWR|O_CREAT );
intf_ErrMsg( "open(...) -> %d", p_aout->p_sys->fd );
intf_WarnMsg( "open(...) -> %d", p_aout->p_sys->fd );
#endif
vlc_cond_init( &p_aout->p_sys->cond_sync );
vlc_mutex_init( &p_aout->p_sys->mutex_lock );
return( 0 );
}
......@@ -204,84 +235,114 @@ static int aout_Open( aout_thread_t *p_aout )
static int aout_SetFormat( aout_thread_t *p_aout )
{
OSStatus err = noErr;
UInt32 count,
bufferSize = p_aout->p_sys->ui_deviceBufferSize;
UInt32 ui_paramSize,
ui_bufferSize = p_aout->p_sys->ui_deviceBufferSize;
AudioStreamBasicDescription format;
// get the buffersize that the default device uses for IO
// it is required to pass the size of the data to be returned
count = sizeof( bufferSize );
/* set the buffersize that the default device uses for IO */
ui_paramSize = sizeof( ui_bufferSize );
err = AudioDeviceSetProperty( p_aout->p_sys->device, 0, 0, false,
kAudioDevicePropertyBufferSize,
count, &bufferSize);
intf_ErrMsg( "AudioDeviceSetProperty( buffersize = %d ) -> %d", bufferSize, err );
if( err == noErr )
ui_paramSize, &ui_bufferSize);
if( err != noErr )
{
/* We have to tell the decoder to use audio device's buffer size */
intf_ErrMsg( "AudioDeviceSetProperty failed ( buffersize = %d ) -> %d",
ui_bufferSize, err );
return( -1 );
}