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
AC_DEFINE(HAVE_NANOSLEEP, 1,
Define if nanosleep is available.)
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_FUNC(inet_aton,,[
......
......@@ -2,7 +2,7 @@
* audio_output.h : audio output interface
*****************************************************************************
* 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>
*
......@@ -36,13 +36,16 @@ struct audio_sample_format_t
/* Describes from which original channels, before downmixing, the
* buffer is derived. */
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;
/* Number of sampleframes contained in one compressed frame. */
unsigned int i_frame_length;
/* Please note that it may be completely arbitrary - buffers are not
* obliged to contain a integral number of so-called "frames". It's
* 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 ) ( \
......
......@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* 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>
* Vincent Seguin <seguin@via.ecp.fr>
......@@ -116,6 +116,10 @@ typedef uint8_t yuv_data_t;
/* Audio volume */
typedef uint16_t audio_volume_t;
#ifndef HAVE_SOCKLEN_T
typedef int socklen_t;
#endif
/*****************************************************************************
* Old types definitions
*****************************************************************************
......
......@@ -4,7 +4,7 @@
* (http://liba52.sf.net/).
*****************************************************************************
* 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>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -222,37 +222,37 @@ static void Interleave( float * p_out, const float * p_in, int i_nb_channels )
* The WG-4 order is appropriate for stereo, quadrophonia, and 5.1 surround.
*
* 6 channel mode
* channel liba52 order WG-4 order
* 0 LFE // L
* 1 L // R
* 2 C // LS
* 3 R // RS
* 4 LS // C
* 5 RS // LFE
* channel liba52 order WG-4 order
* 0 LFE // L
* 1 L // R
* 2 C // LS
* 3 R // RS
* 4 LS // C
* 5 RS // LFE
*
* The liba52 moves channels to the front if there are unused spaces, so
* there is no gap between channels. The translation table says which
* channel of the new stream [use the new channel # as index] is taken
* from which original channel [use the number from the array to address
* the original channel].
* channel of the new stream is taken from which original channel [use
* the new channel as the array index, use the number you get from the
* array to address the original channel].
*/
static const int translation[7][6] =
{{ 0, 0, 0, 0, 0, 0 }, /* 0 channels (rarely used) */
{ 0, 0, 0, 0, 0, 0 }, /* 1 ch */
{ 0, 1, 0, 0, 0, 0 }, /* 2 */
{ 1, 2, 0, 0, 0, 0 }, /* 3 */
{ 1, 3, 2, 0, 0, 0 }, /* 4 */
{ 1, 3, 4, 2, 0, 0 }, /* 5 */
{ 1, 3, 4, 5, 2, 0 }}; /* 6 */
{{ 0, 0, 0, 0, 0, 0 }, /* 0 channels (rarely used) */
{ 0, 0, 0, 0, 0, 0 }, /* 1 ch */
{ 0, 1, 0, 0, 0, 0 }, /* 2 */
{ 1, 2, 0, 0, 0, 0 }, /* 3 */
{ 1, 3, 2, 0, 0, 0 }, /* 4 */
{ 1, 3, 4, 2, 0, 0 }, /* 5 */
{ 1, 3, 4, 5, 2, 0 }}; /* 6 */
int i, j;
for ( j = 0; j < i_nb_channels; j++ )
{
for ( i = 0; i < 256; i++ )
{
p_out[i * i_nb_channels + translation[i_nb_channels][j]]
= p_in[j * 256 + i];
p_out[i * i_nb_channels + j] = p_in[translation[i_nb_channels][j]
* 256 + i];
}
}
}
......
......@@ -2,7 +2,7 @@
* a52tospdif.c : encapsulates A/52 frames into S/PDIF packets
*****************************************************************************
* 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>
* Stphane Borel <stef@via.ecp.fr>
......@@ -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,
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
/* It is not entirely clear which endianness the AC3 stream should have.
* I have been told endianness does not matter, AC3 can be both endian.
* 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 };
# ifndef HAVE_SWAB
#ifndef HAVE_SWAB
u16 i;
# endif
#endif
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_out = p_out_buf->p_buffer;
byte_t * p_tmp;
/* Copy the S/PDIF headers. */
memcpy( p_out, p_sync, 6 );
pi_length = (u16 *)(p_out + 6);
*pi_length = i_length * 8;
/* FIXME : if i_length is odd, the following code sucks. What should
* we do ? --Meuuh */
pi_length = (p_out + 6);
*pi_length = (i_length * 8) & 0xff;
*(pi_length + 1) = (i_length * 8) >> 8;
#ifndef WORDS_BIGENDIAN
# ifdef HAVE_SWAB
#ifdef HAVE_SWAB
swab( p_in, p_out + 8, i_length );
# else
p_out += 8;
#else
p_tmp = p_out + 8;
for ( i = i_length / 2 ; i-- ; )
{
p_out[0] = p_in[1];
p_out[1] = p_in[0];
p_out += 2; p_in += 2;
p_tmp[0] = p_in[1];
p_tmp[1] = p_in[0];
p_tmp += 2; p_in += 2;
}
# endif
#else
p_filter->p_vlc->pf_memcpy( p_out + 8, p_in, i_length );
#endif
p_filter->p_vlc->pf_memset( p_out + 8 + i_length, 0,
......
This diff is collapsed.
......@@ -3,7 +3,6 @@
//
//
// Created by Heiko Panther on Tue Sep 10 2002.
// Copyright (c) 2002 __MyCompanyName__. All rights reserved.
//
#import "asystm.h"
......
......@@ -2,7 +2,7 @@
* ipv4.c: IPv4 network abstraction layer
*****************************************************************************
* 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>
* Mathias Kretschmer <mathias@research.att.com>
......@@ -145,7 +145,7 @@ static int OpenUDP( vlc_object_t * p_this, network_socket_t * p_socket )
#endif
int i_handle, i_opt;
unsigned int i_opt_size;
socklen_t i_opt_size;
struct sockaddr_in sock;
if( i_bind_port == 0 )
......
......@@ -2,7 +2,7 @@
* ipv6.c: IPv6 network abstraction layer
*****************************************************************************
* 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>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -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_handle, i_opt;
unsigned int i_opt_size;
socklen_t i_opt_size;
struct sockaddr_in6 sock;
/* 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