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
84d7ff3f
Commit
84d7ff3f
authored
Nov 12, 2004
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Merged trunk changeset 9286 to 0.8.1 branch.
parent
a5996bf7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
modules/audio_output/portaudio.c
modules/audio_output/portaudio.c
+41
-0
No files found.
modules/audio_output/portaudio.c
View file @
84d7ff3f
...
...
@@ -66,8 +66,25 @@ struct aout_sys_t
int
i_sample_size
;
PaDeviceIndex
i_device_id
;
const
PaDeviceInfo
*
deviceInfo
;
vlc_bool_t
b_chan_reorder
;
/* do we need channel reordering */
int
pi_chan_table
[
AOUT_CHAN_MAX
];
uint32_t
i_channel_mask
;
uint32_t
i_bits_per_sample
;
uint32_t
i_channels
;
};
static
const
uint32_t
pi_channels_in
[]
=
{
AOUT_CHAN_LEFT
,
AOUT_CHAN_RIGHT
,
AOUT_CHAN_MIDDLELEFT
,
AOUT_CHAN_MIDDLERIGHT
,
AOUT_CHAN_REARLEFT
,
AOUT_CHAN_REARRIGHT
,
AOUT_CHAN_CENTER
,
AOUT_CHAN_LFE
,
0
};
static
const
uint32_t
pi_channels_out
[]
=
{
AOUT_CHAN_LEFT
,
AOUT_CHAN_RIGHT
,
AOUT_CHAN_CENTER
,
AOUT_CHAN_LFE
,
AOUT_CHAN_REARLEFT
,
AOUT_CHAN_REARRIGHT
,
AOUT_CHAN_MIDDLELEFT
,
AOUT_CHAN_MIDDLERIGHT
,
0
};
#ifdef PORTAUDIO_IS_SERIOUSLY_BROKEN
static
vlc_bool_t
b_init
=
0
;
static
pa_thread_t
*
pa_thread
;
...
...
@@ -118,6 +135,13 @@ static int paCallback( const void *inputBuffer, void *outputBuffer,
if
(
p_buffer
!=
NULL
)
{
if
(
p_sys
->
b_chan_reorder
)
{
/* Do the channel reordering here */
aout_ChannelReorder
(
p_buffer
->
p_buffer
,
p_buffer
->
i_nb_bytes
,
p_sys
->
i_channels
,
p_sys
->
pi_chan_table
,
p_sys
->
i_bits_per_sample
);
}
p_aout
->
p_vlc
->
pf_memcpy
(
outputBuffer
,
p_buffer
->
p_buffer
,
framesPerBuffer
*
p_sys
->
i_sample_size
);
/* aout_BufferFree may be dangereous here, but then so is
...
...
@@ -437,6 +461,7 @@ static int PAOpenStream( aout_instance_t *p_aout )
PaStreamParameters
paStreamParameters
;
vlc_value_t
val
;
int
i_channels
,
i_err
;
uint32_t
i_channel_mask
;
if
(
var_Get
(
p_aout
,
"audio-device"
,
&
val
)
<
0
)
{
...
...
@@ -474,6 +499,7 @@ static int PAOpenStream( aout_instance_t *p_aout )
i_channels
=
aout_FormatNbChannels
(
&
p_aout
->
output
.
output
);
msg_Dbg
(
p_aout
,
"nb_channels requested = %d"
,
i_channels
);
i_channel_mask
=
p_aout
->
output
.
output
.
i_physical_channels
;
/* Calculate the frame size in bytes */
p_sys
->
i_sample_size
=
4
*
i_channels
;
...
...
@@ -481,6 +507,21 @@ static int PAOpenStream( aout_instance_t *p_aout )
aout_FormatPrepare
(
&
p_aout
->
output
.
output
);
aout_VolumeSoftInit
(
p_aout
);
/* Check for channel reordering */
p_aout
->
output
.
p_sys
->
i_channel_mask
=
i_channel_mask
;
p_aout
->
output
.
p_sys
->
i_bits_per_sample
=
32
;
/* forced to paFloat32 */
p_aout
->
output
.
p_sys
->
i_channels
=
i_channels
;
p_aout
->
output
.
p_sys
->
b_chan_reorder
=
aout_CheckChannelReorder
(
pi_channels_in
,
pi_channels_out
,
i_channel_mask
,
i_channels
,
p_aout
->
output
.
p_sys
->
pi_chan_table
);
if
(
p_aout
->
output
.
p_sys
->
b_chan_reorder
)
{
msg_Dbg
(
p_aout
,
"channel reordering needed"
);
}
paStreamParameters
.
device
=
p_sys
->
i_device_id
;
paStreamParameters
.
channelCount
=
i_channels
;
paStreamParameters
.
sampleFormat
=
paFloat32
;
...
...
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