Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
fb397dc0
Commit
fb397dc0
authored
Dec 10, 2005
by
Derk-Jan Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Backport of the Mac OS X audio fixes to 0.8.4a (fixes #456)
parent
b759e185
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
947 additions
and
528 deletions
+947
-528
Makefile.am
Makefile.am
+0
-4
configure.ac
configure.ac
+6
-6
include/audio_output.h
include/audio_output.h
+3
-0
modules/audio_filter/converter/a52tospdif.c
modules/audio_filter/converter/a52tospdif.c
+34
-27
modules/audio_filter/converter/dtstospdif.c
modules/audio_filter/converter/dtstospdif.c
+30
-16
modules/audio_filter/resampler/Modules.am
modules/audio_filter/resampler/Modules.am
+0
-1
modules/audio_filter/resampler/coreaudio.c
modules/audio_filter/resampler/coreaudio.c
+0
-298
modules/audio_output/Modules.am
modules/audio_output/Modules.am
+0
-1
modules/audio_output/auhal.c
modules/audio_output/auhal.c
+738
-136
modules/audio_output/coreaudio.c
modules/audio_output/coreaudio.c
+135
-39
src/audio_output/common.c
src/audio_output/common.c
+1
-0
No files found.
Makefile.am
View file @
fb397dc0
...
...
@@ -577,8 +577,6 @@ VLC-release.app: vlc
cp
"
$(srcdir)
/
$$
i"
$(top_builddir)
/tmp
;
\
done
mkdir
-p
$(top_builddir)
/tmp/modules/audio_output
cp
$(srcdir)
/modules/audio_output/coreaudio.c
\
$(top_builddir)
/tmp/modules/audio_output/coreaudio.c
mkdir
-p
$(top_builddir)
/tmp/modules/gui/macosx
for
i
in
\
about.h
\
...
...
@@ -691,8 +689,6 @@ VLC.app: vlc
cp
"
$(srcdir)
/
$$
i"
$(top_builddir)
/tmp
;
\
done
mkdir
-p
$(top_builddir)
/tmp/modules/audio_output
cp
$(srcdir)
/modules/audio_output/coreaudio.c
\
$(top_builddir)
/tmp/modules/audio_output/coreaudio.c
mkdir
-p
$(top_builddir)
/tmp/modules/gui/macosx
for
i
in
\
about.h
\
...
...
configure.ac
View file @
fb397dc0
...
...
@@ -3627,14 +3627,14 @@ fi
dnl
dnl CoreAudio plugin
dnl
AC_ARG_ENABLE(
core
audio,
[ --enable-
coreaudio CoreA
udio module (default enabled on MacOS X)])
if test "${enable_
core
audio}" != "no" &&
(test "${SYS}" = "darwin" || test "${enable_
core
audio}" = "yes")
AC_ARG_ENABLE(
macosx-
audio,
[ --enable-
macosx-audio Mac OS X a
udio module (default enabled on MacOS X)])
if test "${enable_
macosx-
audio}" != "no" &&
(test "${SYS}" = "darwin" || test "${enable_
macosx-
audio}" = "yes")
then
AC_CHECK_HEADERS(CoreAudio/CoreAudio.h,
[ VLC_ADD_BUILTINS([
coreaudio
auhal])
VLC_ADD_LDFLAGS([
coreaudio
auhal],[-framework CoreAudio -framework AudioUnit -framework AudioToolbox])
[ VLC_ADD_BUILTINS([auhal])
VLC_ADD_LDFLAGS([auhal],[-framework CoreAudio -framework AudioUnit -framework AudioToolbox])
], [ AC_MSG_ERROR([cannot find CoreAudio headers]) ])
fi
...
...
include/audio_output.h
View file @
fb397dc0
...
...
@@ -41,14 +41,17 @@
# define AOUT_FMT_S16_NE VLC_FOURCC('s','1','6','b')
# define AOUT_FMT_U16_NE VLC_FOURCC('u','1','6','b')
# define AOUT_FMT_S24_NE VLC_FOURCC('s','2','4','b')
# define AOUT_FMT_SPDIF_NE VLC_FOURCC('s','p','d','b')
#else
# define AOUT_FMT_S16_NE VLC_FOURCC('s','1','6','l')
# define AOUT_FMT_U16_NE VLC_FOURCC('u','1','6','l')
# define AOUT_FMT_S24_NE VLC_FOURCC('s','2','4','l')
# define AOUT_FMT_SPDIF_NE VLC_FOURCC('s','p','d','i')
#endif
#define AOUT_FMT_NON_LINEAR( p_format ) \
( ((p_format)->i_format == VLC_FOURCC('s','p','d','i')) \
|| ((p_format)->i_format == VLC_FOURCC('s','p','d','b')) \
|| ((p_format)->i_format == VLC_FOURCC('a','5','2',' ')) \
|| ((p_format)->i_format == VLC_FOURCC('d','t','s',' ')) )
...
...
modules/audio_filter/converter/a52tospdif.c
View file @
fb397dc0
...
...
@@ -62,8 +62,9 @@ static int Create( vlc_object_t *p_this )
{
aout_filter_t
*
p_filter
=
(
aout_filter_t
*
)
p_this
;
if
(
p_filter
->
input
.
i_format
!=
VLC_FOURCC
(
'a'
,
'5'
,
'2'
,
' '
)
||
p_filter
->
output
.
i_format
!=
VLC_FOURCC
(
's'
,
'p'
,
'd'
,
'i'
)
)
if
(
p_filter
->
input
.
i_format
!=
VLC_FOURCC
(
'a'
,
'5'
,
'2'
,
' '
)
||
(
p_filter
->
output
.
i_format
!=
VLC_FOURCC
(
's'
,
'p'
,
'd'
,
'b'
)
&&
p_filter
->
output
.
i_format
!=
VLC_FOURCC
(
's'
,
'p'
,
'd'
,
'i'
)
)
)
{
return
-
1
;
}
...
...
@@ -80,43 +81,49 @@ 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
)
{
/* 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.
/* AC3 is natively big endian. Most SPDIF devices have the native
* endianness of the computersystem.
* On MAc OS X however, little endian devices are also common.
*/
static
const
uint8_t
p_sync
[
6
]
=
{
0x72
,
0xF8
,
0x1F
,
0x4E
,
0x01
,
0x00
};
static
const
uint8_t
p_sync_le
[
6
]
=
{
0x72
,
0xF8
,
0x1F
,
0x4E
,
0x01
,
0x00
};
static
const
uint8_t
p_sync
_be
[
6
]
=
{
0xF8
,
0x72
,
0x4E
,
0x1F
,
0x00
,
0x01
};
#ifndef HAVE_SWAB
byte_t
*
p_tmp
;
uint16_t
i
;
#endif
uint16_t
i_length
=
p_in_buf
->
i_nb_bytes
;
uint8_t
*
pi_length
;
uint16_t
i_frame_size
=
p_in_buf
->
i_nb_bytes
/
2
;
byte_t
*
p_in
=
p_in_buf
->
p_buffer
;
byte_t
*
p_out
=
p_out_buf
->
p_buffer
;
/* Copy the S/PDIF headers. */
memcpy
(
p_out
,
p_sync
,
6
);
pi_length
=
(
p_out
+
6
);
*
pi_length
=
(
i_length
*
8
)
&
0xff
;
*
(
pi_length
+
1
)
=
(
i_length
*
8
)
>>
8
;
#ifdef HAVE_SWAB
swab
(
p_in
,
p_out
+
8
,
i_length
);
#else
p_tmp
=
p_out
+
8
;
for
(
i
=
i_length
/
2
;
i
--
;
)
if
(
p_filter
->
output
.
i_format
==
VLC_FOURCC
(
's'
,
'p'
,
'd'
,
'b'
)
)
{
p_tmp
[
0
]
=
p_in
[
1
];
p_tmp
[
1
]
=
p_in
[
0
];
p_tmp
+=
2
;
p_in
+=
2
;
p_filter
->
p_vlc
->
pf_memcpy
(
p_out
,
p_sync_be
,
6
);
p_out
[
4
]
=
p_in
[
5
]
&
0x7
;
/* bsmod */
p_out
[
6
]
=
(
i_frame_size
>>
4
)
&
0xff
;
p_out
[
7
]
=
(
i_frame_size
<<
4
)
&
0xff
;
p_filter
->
p_vlc
->
pf_memcpy
(
&
p_out
[
8
],
p_in
,
i_frame_size
*
2
);
}
else
{
p_filter
->
p_vlc
->
pf_memcpy
(
p_out
,
p_sync_le
,
6
);
p_out
[
5
]
=
p_in
[
5
]
&
0x7
;
/* bsmod */
p_out
[
6
]
=
(
i_frame_size
<<
4
)
&
0xff
;
p_out
[
7
]
=
(
i_frame_size
>>
4
)
&
0xff
;
#ifdef HAVE_SWAB
swab
(
p_in
,
&
p_out
[
8
],
i_frame_size
*
2
);
#else
p_tmp
=
&
p_out
[
8
];
for
(
i
=
i_frame_size
;
i
--
;
)
{
p_tmp
[
0
]
=
p_in
[
1
];
p_tmp
[
1
]
=
p_in
[
0
];
p_tmp
+=
2
;
p_in
+=
2
;
}
#endif
p_filter
->
p_vlc
->
pf_memset
(
p_out
+
8
+
i_
length
,
0
,
AOUT_SPDIF_SIZE
-
i_length
-
8
);
}
p_filter
->
p_vlc
->
pf_memset
(
p_out
+
8
+
i_
frame_size
*
2
,
0
,
AOUT_SPDIF_SIZE
-
i_frame_size
*
2
-
8
);
p_out_buf
->
i_nb_samples
=
p_in_buf
->
i_nb_samples
;
p_out_buf
->
i_nb_bytes
=
AOUT_SPDIF_SIZE
;
...
...
modules/audio_filter/converter/dtstospdif.c
View file @
fb397dc0
...
...
@@ -79,8 +79,9 @@ static int Create( vlc_object_t *p_this )
{
aout_filter_t
*
p_filter
=
(
aout_filter_t
*
)
p_this
;
if
(
p_filter
->
input
.
i_format
!=
VLC_FOURCC
(
'd'
,
't'
,
's'
,
' '
)
||
p_filter
->
output
.
i_format
!=
VLC_FOURCC
(
's'
,
'p'
,
'd'
,
'i'
)
)
if
(
p_filter
->
input
.
i_format
!=
VLC_FOURCC
(
'd'
,
't'
,
's'
,
' '
)
||
(
p_filter
->
output
.
i_format
!=
VLC_FOURCC
(
's'
,
'p'
,
'd'
,
'i'
)
&&
p_filter
->
output
.
i_format
!=
VLC_FOURCC
(
's'
,
'p'
,
'd'
,
'b'
)
)
)
{
return
-
1
;
}
...
...
@@ -117,9 +118,11 @@ static void Close( 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
)
{
uint32_t
i_ac5_spdif_type
=
0
;
uint16_t
i_fz
=
p_in_buf
->
i_nb_samples
*
4
;
uint16_t
i_frame
,
i_length
=
p_in_buf
->
i_nb_bytes
;
static
const
uint8_t
p_sync
[
6
]
=
{
0x72
,
0xF8
,
0x1F
,
0x4E
,
0x00
,
0x00
};
static
const
uint8_t
p_sync_le
[
6
]
=
{
0x72
,
0xF8
,
0x1F
,
0x4E
,
0x00
,
0x00
};
static
const
uint8_t
p_sync_be
[
6
]
=
{
0xF8
,
0x72
,
0x4E
,
0x1F
,
0x00
,
0x00
};
if
(
p_in_buf
->
i_nb_bytes
!=
p_filter
->
p_sys
->
i_frame_size
)
{
...
...
@@ -156,23 +159,35 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
byte_t
*
p_out
=
p_out_buf
->
p_buffer
+
(
i_frame
*
i_fz
);
byte_t
*
p_in
=
p_filter
->
p_sys
->
p_buf
+
(
i_frame
*
i_length
);
/* Copy the S/PDIF headers. */
memcpy
(
p_out
,
p_sync
,
6
);
switch
(
p_in_buf
->
i_nb_samples
)
{
case
512
:
*
(
p_out
+
4
)
=
0x0B
;
break
;
case
1024
:
*
(
p_out
+
4
)
=
0x0C
;
break
;
case
2048
:
*
(
p_out
+
4
)
=
0x0D
;
break
;
case
512
:
i_ac5_spdif_type
=
0x0B
;
break
;
case
1024
:
i_ac5_spdif_type
=
0x0C
;
break
;
case
2048
:
i_ac5_spdif_type
=
0x0D
;
break
;
}
*
(
p_out
+
6
)
=
(
i_length
*
8
)
&
0xff
;
*
(
p_out
+
7
)
=
(
i_length
*
8
)
>>
8
;
/* Copy the S/PDIF headers. */
if
(
p_filter
->
output
.
i_format
==
VLC_FOURCC
(
's'
,
'p'
,
'd'
,
'b'
)
)
{
p_filter
->
p_vlc
->
pf_memcpy
(
p_out
,
p_sync_be
,
6
);
p_out
[
5
]
=
i_ac5_spdif_type
;
p_out
[
6
]
=
((
i_length
)
>>
5
)
&
0xFF
;
p_out
[
7
]
=
(
i_length
<<
3
)
&
0xFF
;
}
else
{
p_filter
->
p_vlc
->
pf_memcpy
(
p_out
,
p_sync_le
,
6
);
p_out
[
4
]
=
i_ac5_spdif_type
;
p_out
[
6
]
=
(
i_length
<<
3
)
&
0xFF
;
p_out
[
7
]
=
((
i_length
)
>>
5
)
&
0xFF
;
}
if
(
p_in
[
0
]
==
0x1f
||
p_in
[
0
]
==
0x7f
)
if
(
(
(
p_in
[
0
]
==
0x1F
||
p_in
[
0
]
==
0x7F
)
&&
p_filter
->
output
.
i_format
==
VLC_FOURCC
(
's'
,
'p'
,
'd'
,
'i'
)
)
||
(
(
p_in
[
0
]
==
0xFF
||
p_in
[
0
]
==
0xFE
)
&&
p_filter
->
output
.
i_format
==
VLC_FOURCC
(
's'
,
'p'
,
'd'
,
'b'
)
)
)
{
/* We are dealing with a big endian bitstream.
* Convert to little endian */
/* We are dealing with a big endian bitstream and a little endian output
* or a little endian bitstream and a big endian output.
* Byteswap the stream */
#ifdef HAVE_SWAB
swab
(
p_in
,
p_out
+
8
,
i_length
);
#else
...
...
@@ -190,8 +205,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
}
else
{
/* Little endian */
memcpy
(
p_out
+
8
,
p_in
,
i_length
);
p_filter
->
p_vlc
->
pf_memcpy
(
p_out
+
8
,
p_in
,
i_length
);
}
if
(
i_fz
>
i_length
+
8
)
...
...
modules/audio_filter/resampler/Modules.am
View file @
fb397dc0
...
...
@@ -2,4 +2,3 @@ SOURCES_trivial_resampler = trivial.c
SOURCES_ugly_resampler = ugly.c
SOURCES_linear_resampler = linear.c
SOURCES_bandlimited_resampler = bandlimited.c bandlimited.h
SOURCES_coreaudio_resampler = coreaudio.c
modules/audio_filter/resampler/coreaudio.c
deleted
100644 → 0
View file @
b759e185
This diff is collapsed.
Click to expand it.
modules/audio_output/Modules.am
View file @
fb397dc0
SOURCES_alsa = alsa.c
SOURCES_arts = arts.c
SOURCES_coreaudio = coreaudio.c
SOURCES_aout_directx = directx.c
SOURCES_esd = esd.c
SOURCES_aout_file = file.c
...
...
modules/audio_output/auhal.c
View file @
fb397dc0
This diff is collapsed.
Click to expand it.
modules/audio_output/coreaudio.c
View file @
fb397dc0
This diff is collapsed.
Click to expand it.
src/audio_output/common.c
View file @
fb397dc0
...
...
@@ -142,6 +142,7 @@ void aout_FormatPrepare( audio_sample_format_t * p_format )
break
;
case
VLC_FOURCC
(
's'
,
'p'
,
'd'
,
'i'
):
case
VLC_FOURCC
(
's'
,
'p'
,
'd'
,
'b'
):
/* Big endian spdif output */
case
VLC_FOURCC
(
'a'
,
'5'
,
'2'
,
' '
):
case
VLC_FOURCC
(
'd'
,
't'
,
's'
,
' '
):
case
VLC_FOURCC
(
'm'
,
'p'
,
'g'
,
'a'
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment