Commit 60b9d5a5 authored by Christophe Massiot's avatar Christophe Massiot

* Correct socklen_t detection.

* Fix for S/PDIF encapsulation on big endian systems.
* S/PDIF output for Mac OS X, courtesy of Heiko Panther <heiko_panthe@mac.com>.
parent d43c4059
...@@ -283,7 +283,21 @@ if ${have_nanosleep}; then ...@@ -283,7 +283,21 @@ if ${have_nanosleep}; then
AC_DEFINE(HAVE_NANOSLEEP, 1, AC_DEFINE(HAVE_NANOSLEEP, 1,
Define if nanosleep is available.) Define if nanosleep is available.)
fi fi
# HP/UX port
dnl Check for socklen_t
AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
[AC_TRY_COMPILE(
[#include <sys/types.h>
#include <sys/socket.h>],
[socklen_t len = 42; return len;],
ac_cv_type_socklen_t=yes,
ac_cv_type_socklen_t=no)])
if test x$ac_cv_type_socklen_t != xno; then
AC_DEFINE(HAVE_SOCKLEN_T, 1,
Define if <sys/socket.h> defines socklen_t.)
fi
dnl HP/UX port
AC_CHECK_LIB(rt,sem_init, [LDFLAGS_vlc="${LDFLAGS_vlc} -lrt"]) AC_CHECK_LIB(rt,sem_init, [LDFLAGS_vlc="${LDFLAGS_vlc} -lrt"])
AC_CHECK_FUNC(inet_aton,,[ AC_CHECK_FUNC(inet_aton,,[
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* audio_output.h : audio output interface * audio_output.h : audio output interface
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: audio_output.h,v 1.71 2002/11/14 22:38:46 massiot Exp $ * $Id: audio_output.h,v 1.72 2002/11/28 23:24:14 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -36,13 +36,16 @@ struct audio_sample_format_t ...@@ -36,13 +36,16 @@ struct audio_sample_format_t
/* Describes from which original channels, before downmixing, the /* Describes from which original channels, before downmixing, the
* buffer is derived. */ * buffer is derived. */
u32 i_original_channels; u32 i_original_channels;
/* Optional - for A52, SPDIF and DTS types */ /* Optional - for A/52, SPDIF and DTS types : */
/* Bytes used by one compressed frame, depends on bitrate. */
unsigned int i_bytes_per_frame; unsigned int i_bytes_per_frame;
/* Number of sampleframes contained in one compressed frame. */
unsigned int i_frame_length; unsigned int i_frame_length;
/* Please note that it may be completely arbitrary - buffers are not /* Please note that it may be completely arbitrary - buffers are not
* obliged to contain a integral number of so-called "frames". It's * obliged to contain a integral number of so-called "frames". It's
* just here for the division : * just here for the division :
* i_nb_samples * i_bytes_per_frame / i_frame_length */ * buffer_size = i_nb_samples * i_bytes_per_frame / i_frame_length
*/
}; };
#define AOUT_FMTS_IDENTICAL( p_first, p_second ) ( \ #define AOUT_FMTS_IDENTICAL( p_first, p_second ) ( \
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions * Collection of useful common types and macros definitions
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc_common.h,v 1.41 2002/11/25 03:12:42 ipkiss Exp $ * $Id: vlc_common.h,v 1.42 2002/11/28 23:24:14 massiot Exp $
* *
* Authors: Samuel Hocevar <sam@via.ecp.fr> * Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr> * Vincent Seguin <seguin@via.ecp.fr>
...@@ -116,6 +116,10 @@ typedef uint8_t yuv_data_t; ...@@ -116,6 +116,10 @@ typedef uint8_t yuv_data_t;
/* Audio volume */ /* Audio volume */
typedef uint16_t audio_volume_t; typedef uint16_t audio_volume_t;
#ifndef HAVE_SOCKLEN_T
typedef int socklen_t;
#endif
/***************************************************************************** /*****************************************************************************
* Old types definitions * Old types definitions
***************************************************************************** *****************************************************************************
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* (http://liba52.sf.net/). * (http://liba52.sf.net/).
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: a52tofloat32.c,v 1.8 2002/11/21 23:06:08 massiot Exp $ * $Id: a52tofloat32.c,v 1.9 2002/11/28 23:24:14 massiot Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* Christophe Massiot <massiot@via.ecp.fr> * Christophe Massiot <massiot@via.ecp.fr>
...@@ -232,9 +232,9 @@ static void Interleave( float * p_out, const float * p_in, int i_nb_channels ) ...@@ -232,9 +232,9 @@ static void Interleave( float * p_out, const float * p_in, int i_nb_channels )
* *
* The liba52 moves channels to the front if there are unused spaces, so * The liba52 moves channels to the front if there are unused spaces, so
* there is no gap between channels. The translation table says which * there is no gap between channels. The translation table says which
* channel of the new stream [use the new channel # as index] is taken * channel of the new stream is taken from which original channel [use
* from which original channel [use the number from the array to address * the new channel as the array index, use the number you get from the
* the original channel]. * array to address the original channel].
*/ */
static const int translation[7][6] = static const int translation[7][6] =
...@@ -251,8 +251,8 @@ static void Interleave( float * p_out, const float * p_in, int i_nb_channels ) ...@@ -251,8 +251,8 @@ static void Interleave( float * p_out, const float * p_in, int i_nb_channels )
{ {
for ( i = 0; i < 256; i++ ) for ( i = 0; i < 256; i++ )
{ {
p_out[i * i_nb_channels + translation[i_nb_channels][j]] p_out[i * i_nb_channels + j] = p_in[translation[i_nb_channels][j]
= p_in[j * 256 + i]; * 256 + i];
} }
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* a52tospdif.c : encapsulates A/52 frames into S/PDIF packets * a52tospdif.c : encapsulates A/52 frames into S/PDIF packets
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: a52tospdif.c,v 1.14 2002/11/20 13:37:35 sam Exp $ * $Id: a52tospdif.c,v 1.15 2002/11/28 23:24:14 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -78,42 +78,39 @@ static int Create( vlc_object_t *p_this ) ...@@ -78,42 +78,39 @@ static int Create( vlc_object_t *p_this )
static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter, 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 ) aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf )
{ {
#ifdef WORDS_BIGENDIAN /* It is not entirely clear which endianness the AC3 stream should have.
static const u8 p_sync[6] = { 0xF8, 0x72, 0x4E, 0x1F, 0x00, 0x01 }; * I have been told endianness does not matter, AC3 can be both endian.
#else * But then, I could not get it to work on Mac OS X and a JVC RX-6000R
* decoder without using little endian. So right now, I convert to little
* endian.
*/
static const u8 p_sync[6] = { 0x72, 0xF8, 0x1F, 0x4E, 0x01, 0x00 }; static const u8 p_sync[6] = { 0x72, 0xF8, 0x1F, 0x4E, 0x01, 0x00 };
# ifndef HAVE_SWAB #ifndef HAVE_SWAB
u16 i; u16 i;
# endif
#endif #endif
u16 i_length = p_in_buf->i_nb_bytes; u16 i_length = p_in_buf->i_nb_bytes;
u16 * pi_length; u8 * pi_length;
byte_t * p_in = p_in_buf->p_buffer; byte_t * p_in = p_in_buf->p_buffer;
byte_t * p_out = p_out_buf->p_buffer; byte_t * p_out = p_out_buf->p_buffer;
byte_t * p_tmp;
/* Copy the S/PDIF headers. */ /* Copy the S/PDIF headers. */
memcpy( p_out, p_sync, 6 ); memcpy( p_out, p_sync, 6 );
pi_length = (u16 *)(p_out + 6); pi_length = (p_out + 6);
*pi_length = i_length * 8; *pi_length = (i_length * 8) & 0xff;
*(pi_length + 1) = (i_length * 8) >> 8;
/* FIXME : if i_length is odd, the following code sucks. What should
* we do ? --Meuuh */
#ifndef WORDS_BIGENDIAN #ifdef HAVE_SWAB
# ifdef HAVE_SWAB
swab( p_in, p_out + 8, i_length ); swab( p_in, p_out + 8, i_length );
# else #else
p_out += 8; p_tmp = p_out + 8;
for ( i = i_length / 2 ; i-- ; ) for ( i = i_length / 2 ; i-- ; )
{ {
p_out[0] = p_in[1]; p_tmp[0] = p_in[1];
p_out[1] = p_in[0]; p_tmp[1] = p_in[0];
p_out += 2; p_in += 2; p_tmp += 2; p_in += 2;
} }
# endif
#else
p_filter->p_vlc->pf_memcpy( p_out + 8, p_in, i_length );
#endif #endif
p_filter->p_vlc->pf_memset( p_out + 8 + i_length, 0, p_filter->p_vlc->pf_memset( p_out + 8 + i_length, 0,
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* aout.m: CoreAudio output plugin * aout.m: CoreAudio output plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: aout.m,v 1.15 2002/11/18 23:00:41 massiot Exp $ * $Id: aout.m,v 1.16 2002/11/28 23:24:15 massiot Exp $
* *
* Authors: Colin Delacroix <colin@zoy.org> * Authors: Colin Delacroix <colin@zoy.org>
* Jon Lech Johansen <jon-vl@nanocrew.net> * Jon Lech Johansen <jon-vl@nanocrew.net>
...@@ -107,13 +107,17 @@ int E_(OpenAudio)( vlc_object_t * p_this ) ...@@ -107,13 +107,17 @@ int E_(OpenAudio)( vlc_object_t * p_this )
/* Get a description of the data format used by the device */ /* Get a description of the data format used by the device */
i_param_size = sizeof(AudioStreamBasicDescription); i_param_size = sizeof(AudioStreamBasicDescription);
err = AudioDeviceGetProperty(p_sys->device, 0, false, kAudioDevicePropertyStreamFormat, &i_param_size, &p_sys->stream_format ); err = AudioDeviceGetProperty(p_sys->device, 0, false, kAudioDevicePropertyStreamFormat,
&i_param_size, &p_sys->stream_format );
if( err != noErr ) if( err != noErr )
{ {
msg_Err( p_aout, "failed to get stream format: %4.4s", &err ); msg_Err( p_aout, "failed to get stream format: %4.4s", &err );
return -1 ; return -1 ;
} }
/* Now we know the sample rate of the device */
p_aout->output.output.i_rate = p_sys->stream_format.mSampleRate;
msg_Dbg( p_aout, "mSampleRate %ld, mFormatID %4.4s, mFormatFlags %ld, mBytesPerPacket %ld, mFramesPerPacket %ld, mBytesPerFrame %ld, mChannelsPerFrame %ld, mBitsPerChannel %ld", msg_Dbg( p_aout, "mSampleRate %ld, mFormatID %4.4s, mFormatFlags %ld, mBytesPerPacket %ld, mFramesPerPacket %ld, mBytesPerFrame %ld, mChannelsPerFrame %ld, mBitsPerChannel %ld",
(UInt32)p_sys->stream_format.mSampleRate, &p_sys->stream_format.mFormatID, (UInt32)p_sys->stream_format.mSampleRate, &p_sys->stream_format.mFormatID,
p_sys->stream_format.mFormatFlags, p_sys->stream_format.mBytesPerPacket, p_sys->stream_format.mFormatFlags, p_sys->stream_format.mBytesPerPacket,
...@@ -123,6 +127,40 @@ int E_(OpenAudio)( vlc_object_t * p_this ) ...@@ -123,6 +127,40 @@ int E_(OpenAudio)( vlc_object_t * p_this )
msg_Dbg( p_aout, "vlc format %4.4s, mac output format '%4.4s'", msg_Dbg( p_aout, "vlc format %4.4s, mac output format '%4.4s'",
(char *)&p_aout->output.output.i_format, &p_sys->stream_format.mFormatID ); (char *)&p_aout->output.output.i_format, &p_sys->stream_format.mFormatID );
/* Get the buffer size that the device uses for IO */
// If we do PCM, use the device's given buffer size
// If we do raw AC3, we could use the devices given size too
// If we do AC3 over SPDIF, force the size of one AC3 frame
// (I think we need to do that because of the packetizer)
i_param_size = sizeof( p_sys->i_buffer_size );
err = AudioDeviceGetProperty( p_sys->device, 0, false,
kAudioDevicePropertyBufferSize,
&i_param_size, &p_sys->i_buffer_size );
if(err) {
msg_Err(p_aout, "failed to get buffer size - err %4.4s, device %ld", &err, p_sys->device);
return -1;
}
else msg_Dbg( p_aout, "native buffer Size: %d", p_sys->i_buffer_size );
if((p_sys->stream_format.mFormatID==kAudioFormat60958AC3
|| p_sys->stream_format.mFormatID=='IAC3')
&& p_sys->i_buffer_size != AOUT_SPDIF_SIZE)
{
p_sys->i_buffer_size = AOUT_SPDIF_SIZE;
i_param_size = sizeof( p_sys->i_buffer_size );
err = AudioDeviceSetProperty( p_sys->device, 0, 0, false,
kAudioDevicePropertyBufferSize,
i_param_size, &p_sys->i_buffer_size );
if( err != noErr )
{
msg_Err( p_aout, "failed to set device buffer size: %4.4s", &err );
return -1;
}
else msg_Dbg(p_aout, "bufferSize set to %d", p_sys->i_buffer_size);
};
// We now know the buffer size in bytes. Set the values for the vlc converters.
switch(p_sys->stream_format.mFormatID) switch(p_sys->stream_format.mFormatID)
{ {
case 0: case 0:
...@@ -136,15 +174,37 @@ int E_(OpenAudio)( vlc_object_t * p_this ) ...@@ -136,15 +174,37 @@ int E_(OpenAudio)( vlc_object_t * p_this )
= AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT = AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT
| AOUT_CHAN_CENTER | AOUT_CHAN_REARRIGHT | AOUT_CHAN_CENTER | AOUT_CHAN_REARRIGHT
| AOUT_CHAN_REARLEFT | AOUT_CHAN_LFE; | AOUT_CHAN_REARLEFT | AOUT_CHAN_LFE;
p_aout->output.i_nb_samples = p_sys->i_buffer_size / p_sys->stream_format.mBytesPerFrame;
break; break;
case kAudioFormat60958AC3: case kAudioFormat60958AC3:
case 'IAC3': case 'IAC3':
p_aout->output.output.i_format = VLC_FOURCC('s','p','d','i'); p_aout->output.output.i_format = VLC_FOURCC('s','p','d','i');
//not necessary, use the input's format by default --Meuuh msg_Dbg(p_aout, "phychan %d, ochan %d, bytes/fr %d, frlen %d",
//p_aout->output.output.i_channels = AOUT_CHAN_DOLBY | AOUT_CHAN_LFE; p_aout->output.output.i_physical_channels,
p_aout->output.output.i_original_channels,
p_aout->output.output.i_bytes_per_frame,
p_aout->output.output.i_frame_length);
p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE; //p_sys->stream_format.mBytesPerFrame; p_aout->output.output.i_bytes_per_frame = AOUT_SPDIF_SIZE; //p_sys->stream_format.mBytesPerFrame;
p_aout->output.output.i_frame_length = A52_FRAME_NB; //p_sys->stream_format.mFramesPerPacket; p_aout->output.output.i_frame_length = A52_FRAME_NB; //p_sys->stream_format.mFramesPerPacket;
p_aout->output.i_nb_samples = p_aout->output.output.i_frame_length;
//Probably not needed after all
// Some more settings to make the SPDIF device work... Other SPDIF Devices might need additional
// values here. But don't change these, in order to not break existing devices. Either add values
// which are not being set here, or check if the SetProperty was successful, and try another version
// if not.
// p_sys->stream_format.mBytesPerFrame=4; // usually set to 0 for AC3 by the system
// p_sys->stream_format.mFormatFlags|=kAudioFormatFlagIsBigEndian;
// +kAudioFormatFlagIsPacked
// +kAudioFormatFlagIsNonInterleaved;
// p_sys->stream_format.mBytesPerPacket=6144;
// p_sys->stream_format.mFramesPerPacket=1536;
break; break;
default: default:
...@@ -152,39 +212,58 @@ int E_(OpenAudio)( vlc_object_t * p_this ) ...@@ -152,39 +212,58 @@ int E_(OpenAudio)( vlc_object_t * p_this )
return -1; return -1;
} }
/* Set sample rate and channels per frame */
p_aout->output.output.i_rate = p_sys->stream_format.mSampleRate;
/* Get the buffer size that the device uses for IO */ // Now tell the device how many sample frames to expect in each buffer
i_param_size = sizeof( p_sys->i_buffer_size ); i_param_size=sizeof(p_aout->output.i_nb_samples);
#if 1 // i have a feeling we should use the buffer size imposed by the AC3 device (usually about 6144) #if 0
err = AudioDeviceGetProperty( p_sys->device, 1, false, err = AudioDeviceGetProperty( p_sys->device, 0, false,
kAudioDevicePropertyBufferSize, kAudioDevicePropertyBufferFrameSize,
&i_param_size, &p_sys->i_buffer_size ); &i_param_size, &p_aout->output.i_nb_samples);
if(err) { if(err) {
msg_Err(p_aout, "failed to get buffer size - err %4.4s, device %ld", &err, p_sys->device); msg_Err(p_aout, "failed to get BufferFrameSize - err %4.4s, device %ld", &err, p_sys->device);
return -1; return -1;
} }
else msg_Dbg( p_aout, "native buffer Size: %d", p_sys->i_buffer_size ); else msg_Dbg( p_aout, "native BufferFrameSize: %d", p_aout->output.i_nb_samples);
#else #else
p_sys->i_buffer_size = p_aout->output.output.i_bytes_per_frame; err = AudioDeviceSetProperty( p_sys->device, 0, 0, false,
err = AudioDeviceSetProperty( p_sys->device, 0, 1, false, kAudioDevicePropertyBufferFrameSize,
kAudioDevicePropertyBufferSize, i_param_size, &p_aout->output.i_nb_samples);
i_param_size, &p_sys->i_buffer_size );
if( err != noErr ) if( err != noErr )
{ {
msg_Err( p_aout, "failed to set device buffer size: %4.4s", err ); msg_Err( p_aout, "failed to set BufferFrameSize: %4.4s", &err );
return( -1 ); return -1;
} }
else msg_Dbg(p_aout, "bufferSize set to %d", p_sys->i_buffer_size); else msg_Dbg(p_aout, "bufferFrameSize set to %d", p_aout->output.i_nb_samples);
#endif #endif
p_aout->output.i_nb_samples = p_sys->i_buffer_size / p_sys->stream_format.mBytesPerFrame; /*
// And set the device format, since we might have changed some of it above
i_param_size = sizeof(AudioStreamBasicDescription);
err = AudioDeviceSetProperty(p_sys->device, 0, 0, false, kAudioDevicePropertyStreamFormat,
i_param_size, &p_sys->stream_format );
if( err != noErr )
{
msg_Err( p_aout, "failed to set stream format: %4.4s", &err );
return -1 ;
}
else
msg_Dbg( p_aout, "set: mSampleRate %ld, mFormatID %4.4s, mFormatFlags %ld, mBytesPerPacket %ld, mFramesPerPacket %ld, mBytesPerFrame %ld, mChannelsPerFrame %ld, mBitsPerChannel %ld",
(UInt32)p_sys->stream_format.mSampleRate, &p_sys->stream_format.mFormatID,
p_sys->stream_format.mFormatFlags, p_sys->stream_format.mBytesPerPacket,
p_sys->stream_format.mFramesPerPacket, p_sys->stream_format.mBytesPerFrame,
p_sys->stream_format.mChannelsPerFrame, p_sys->stream_format.mBitsPerChannel );
*/
/* Add callback */ /* Add callback */
err = AudioDeviceAddIOProc( p_sys->device, err = AudioDeviceAddIOProc( p_sys->device,
(AudioDeviceIOProc)IOCallback, (AudioDeviceIOProc)IOCallback,
(void *)p_aout ); (void *)p_aout );
if( err != noErr )
{
msg_Err( p_aout, "AudioDeviceAddIOProc failed: %4.4s", &err );
return -1;
}
/* Open the output with callback IOCallback */ /* Open the output with callback IOCallback */
err = AudioDeviceStart( p_sys->device, err = AudioDeviceStart( p_sys->device,
...@@ -216,7 +295,14 @@ void E_(CloseAudio)( aout_instance_t * p_aout ) ...@@ -216,7 +295,14 @@ void E_(CloseAudio)( aout_instance_t * p_aout )
(AudioDeviceIOProc)IOCallback ); (AudioDeviceIOProc)IOCallback );
if( err != noErr ) if( err != noErr )
{ {
msg_Err( p_aout, "AudioDeviceStop failed: %d", err ); msg_Err( p_aout, "AudioDeviceStop failed: %4.4s", &err );
}
err = AudioDeviceRemoveIOProc( p_sys->device,
(AudioDeviceIOProc)IOCallback );
if( err != noErr )
{
msg_Err( p_aout, "AudioDeviceRemoveIOProc failed: %4.4s", &err );
} }
free( p_sys ); free( p_sys );
...@@ -229,6 +315,7 @@ static void Play( aout_instance_t * p_aout ) ...@@ -229,6 +315,7 @@ static void Play( aout_instance_t * p_aout )
{ {
} }
#include <syslog.h>
/***************************************************************************** /*****************************************************************************
* IOCallback : callback for audio output * IOCallback : callback for audio output
*****************************************************************************/ *****************************************************************************/
...@@ -251,7 +338,6 @@ static OSStatus IOCallback( AudioDeviceID inDevice, ...@@ -251,7 +338,6 @@ static OSStatus IOCallback( AudioDeviceID inDevice,
current_date = p_sys->clock_diff current_date = p_sys->clock_diff
+ AudioConvertHostTimeToNanos(host_time.mHostTime) / 1000; + AudioConvertHostTimeToNanos(host_time.mHostTime) / 1000;
// msg_Dbg(p_aout, "Now fetching audio data");
p_buffer = aout_OutputNextBuffer( p_aout, current_date, (p_aout->output.output.i_format == VLC_FOURCC('s','p','d','i')) ); p_buffer = aout_OutputNextBuffer( p_aout, current_date, (p_aout->output.output.i_format == VLC_FOURCC('s','p','d','i')) );
/* move data into output data buffer */ /* move data into output data buffer */
...@@ -260,14 +346,7 @@ static OSStatus IOCallback( AudioDeviceID inDevice, ...@@ -260,14 +346,7 @@ static OSStatus IOCallback( AudioDeviceID inDevice,
BlockMoveData( p_buffer->p_buffer, BlockMoveData( p_buffer->p_buffer,
outOutputData->mBuffers[ 0 ].mData, outOutputData->mBuffers[ 0 ].mData,
p_sys->i_buffer_size ); p_sys->i_buffer_size );
// syslog(LOG_INFO, "convert: %08lX %08lX %08lX", ((long*)p_buffer->p_buffer)[0], ((long*)p_buffer->p_buffer)[1], ((long*)p_buffer->p_buffer)[2]);
/* 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 ); aout_BufferFree( p_buffer );
} }
else else
...@@ -275,6 +354,9 @@ static OSStatus IOCallback( AudioDeviceID inDevice, ...@@ -275,6 +354,9 @@ static OSStatus IOCallback( AudioDeviceID inDevice,
memset(outOutputData->mBuffers[ 0 ].mData, 0, p_sys->i_buffer_size); memset(outOutputData->mBuffers[ 0 ].mData, 0, p_sys->i_buffer_size);
} }
// outOutputData->mBuffers[0].mDataByteSize=p_sys->i_buffer_size;
return noErr; return noErr;
} }
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
// //
// //
// Created by Heiko Panther on Tue Sep 10 2002. // Created by Heiko Panther on Tue Sep 10 2002.
// Copyright (c) 2002 __MyCompanyName__. All rights reserved.
// //
#import "asystm.h" #import "asystm.h"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ipv4.c: IPv4 network abstraction layer * ipv4.c: IPv4 network abstraction layer
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: ipv4.c,v 1.6 2002/11/23 04:40:53 sam Exp $ * $Id: ipv4.c,v 1.7 2002/11/28 23:24:15 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Mathias Kretschmer <mathias@research.att.com> * Mathias Kretschmer <mathias@research.att.com>
...@@ -145,7 +145,7 @@ static int OpenUDP( vlc_object_t * p_this, network_socket_t * p_socket ) ...@@ -145,7 +145,7 @@ static int OpenUDP( vlc_object_t * p_this, network_socket_t * p_socket )
#endif #endif
int i_handle, i_opt; int i_handle, i_opt;
unsigned int i_opt_size; socklen_t i_opt_size;
struct sockaddr_in sock; struct sockaddr_in sock;
if( i_bind_port == 0 ) if( i_bind_port == 0 )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ipv6.c: IPv6 network abstraction layer * ipv6.c: IPv6 network abstraction layer
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: ipv6.c,v 1.4 2002/11/19 20:56:45 gbazin Exp $ * $Id: ipv6.c,v 1.5 2002/11/28 23:24:15 massiot Exp $
* *
* Authors: Alexis Guillard <alexis.guillard@bt.com> * Authors: Alexis Guillard <alexis.guillard@bt.com>
* Christophe Massiot <massiot@via.ecp.fr> * Christophe Massiot <massiot@via.ecp.fr>
...@@ -230,7 +230,7 @@ static int OpenUDP( vlc_object_t * p_this, network_socket_t * p_socket ) ...@@ -230,7 +230,7 @@ static int OpenUDP( vlc_object_t * p_this, network_socket_t * p_socket )
int i_server_port = p_socket->i_server_port; int i_server_port = p_socket->i_server_port;
int i_handle, i_opt; int i_handle, i_opt;
unsigned int i_opt_size; socklen_t i_opt_size;
struct sockaddr_in6 sock; struct sockaddr_in6 sock;
/* Open a SOCK_DGRAM (UDP) socket, in the AF_INET6 domain, automatic (0) /* Open a SOCK_DGRAM (UDP) socket, in the AF_INET6 domain, automatic (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