Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
714c9998
Commit
714c9998
authored
Nov 06, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
headphone: setup filter_t on success and rationalize
Use input rate rather than output rate to avoid extra resampling.
parent
3fc1801a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
38 deletions
+12
-38
modules/audio_filter/channel_mixer/headphone.c
modules/audio_filter/channel_mixer/headphone.c
+12
-38
No files found.
modules/audio_filter/channel_mixer/headphone.c
View file @
714c9998
...
...
@@ -441,7 +441,6 @@ static int OpenFilter( vlc_object_t *p_this )
{
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
filter_sys_t
*
p_sys
;
bool
b_fit
=
true
;
/* Activate this filter only with stereo devices */
if
(
p_filter
->
fmt_out
.
audio
.
i_physical_channels
...
...
@@ -451,42 +450,6 @@ static int OpenFilter( vlc_object_t *p_this )
return
VLC_EGENERIC
;
}
/* Request a specific format if not already compatible */
if
(
p_filter
->
fmt_in
.
audio
.
i_original_channels
!=
p_filter
->
fmt_out
.
audio
.
i_original_channels
)
{
b_fit
=
false
;
p_filter
->
fmt_in
.
audio
.
i_original_channels
=
p_filter
->
fmt_out
.
audio
.
i_original_channels
;
}
if
(
p_filter
->
fmt_in
.
audio
.
i_format
!=
VLC_CODEC_FL32
||
p_filter
->
fmt_out
.
audio
.
i_format
!=
VLC_CODEC_FL32
)
{
b_fit
=
false
;
p_filter
->
fmt_in
.
audio
.
i_format
=
VLC_CODEC_FL32
;
p_filter
->
fmt_out
.
audio
.
i_format
=
VLC_CODEC_FL32
;
}
if
(
p_filter
->
fmt_in
.
audio
.
i_rate
!=
p_filter
->
fmt_out
.
audio
.
i_rate
)
{
b_fit
=
false
;
p_filter
->
fmt_in
.
audio
.
i_rate
=
p_filter
->
fmt_out
.
audio
.
i_rate
;
}
if
(
p_filter
->
fmt_in
.
audio
.
i_physical_channels
==
(
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
)
&&
(
p_filter
->
fmt_in
.
audio
.
i_original_channels
&
AOUT_CHAN_DOLBYSTEREO
)
&&
!
var_InheritBool
(
p_filter
,
"headphone-dolby"
)
)
{
b_fit
=
false
;
p_filter
->
fmt_in
.
audio
.
i_physical_channels
=
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
|
AOUT_CHAN_CENTER
|
AOUT_CHAN_REARLEFT
|
AOUT_CHAN_REARRIGHT
;
}
if
(
!
b_fit
)
{
msg_Dbg
(
p_filter
,
"requesting specific format"
);
return
VLC_EGENERIC
;
}
/* Allocate the memory needed to store the module's structure */
p_sys
=
p_filter
->
p_sys
=
malloc
(
sizeof
(
struct
filter_sys_t
)
);
if
(
p_sys
==
NULL
)
...
...
@@ -505,8 +468,19 @@ static int OpenFilter( vlc_object_t *p_this )
return
VLC_EGENERIC
;
}
p_filter
->
pf_audio_filter
=
Convert
;
/* Request a specific format if not already compatible */
p_filter
->
fmt_in
.
audio
.
i_format
=
VLC_CODEC_FL32
;
p_filter
->
fmt_out
.
audio
.
i_format
=
VLC_CODEC_FL32
;
p_filter
->
fmt_out
.
audio
.
i_rate
=
p_filter
->
fmt_in
.
audio
.
i_rate
;
p_filter
->
fmt_in
.
audio
.
i_original_channels
=
p_filter
->
fmt_out
.
audio
.
i_original_channels
;
if
(
p_filter
->
fmt_in
.
audio
.
i_physical_channels
==
AOUT_CHANS_STEREO
&&
(
p_filter
->
fmt_in
.
audio
.
i_original_channels
&
AOUT_CHAN_DOLBYSTEREO
)
&&
!
var_InheritBool
(
p_filter
,
"headphone-dolby"
)
)
{
p_filter
->
fmt_in
.
audio
.
i_physical_channels
=
AOUT_CHANS_5_0
;
}
p_filter
->
pf_audio_filter
=
Convert
;
return
VLC_SUCCESS
;
}
...
...
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