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
679039d9
Commit
679039d9
authored
Jun 19, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No need to test for NULL here.
parent
552b005a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
105 additions
and
124 deletions
+105
-124
modules/audio_filter/channel_mixer/dolby.c
modules/audio_filter/channel_mixer/dolby.c
+44
-52
modules/audio_filter/channel_mixer/headphone.c
modules/audio_filter/channel_mixer/headphone.c
+61
-72
No files found.
modules/audio_filter/channel_mixer/dolby.c
View file @
679039d9
...
...
@@ -157,12 +157,7 @@ static int Create( vlc_object_t *p_this )
static
void
Destroy
(
vlc_object_t
*
p_this
)
{
aout_filter_t
*
p_filter
=
(
aout_filter_t
*
)
p_this
;
if
(
p_filter
->
p_sys
!=
NULL
)
{
free
(
p_filter
->
p_sys
);
p_filter
->
p_sys
=
NULL
;
}
free
(
p_filter
->
p_sys
);
}
/*****************************************************************************
...
...
@@ -172,42 +167,40 @@ 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
)
{
VLC_UNUSED
(
p_aout
);
aout_filter_sys_t
*
p_sys
=
p_filter
->
p_sys
;
float
*
p_in
=
(
float
*
)
p_in_buf
->
p_buffer
;
float
*
p_out
=
(
float
*
)
p_out_buf
->
p_buffer
;
size_t
i_nb_samples
=
p_in_buf
->
i_nb_samples
;
size_t
i_nb_channels
=
aout_FormatNbChannels
(
&
p_filter
->
output
);
size_t
i_nb_rear
=
0
;
size_t
i
;
p_out_buf
->
i_nb_samples
=
i_nb_samples
;
p_out_buf
->
i_nb_bytes
=
sizeof
(
float
)
*
i_nb_samples
*
aout_FormatNbChannels
(
&
p_filter
->
output
);
memset
(
p_out
,
0
,
p_out_buf
->
i_nb_bytes
);
memset
(
p_out
,
0
,
p_out_buf
->
i_nb_bytes
);
if
(
p_filter
->
p_sys
!=
NULL
)
{
struct
aout_filter_sys_t
*
p_sys
=
p_filter
->
p_sys
;
size_t
i_nb_rear
=
0
;
size_t
i
;
if
(
p_sys
->
i_rear_left
>=
0
)
if
(
p_sys
->
i_rear_left
>=
0
)
{
++
i_nb_rear
;
}
if
(
p_sys
->
i_rear_center
>=
0
)
if
(
p_sys
->
i_rear_center
>=
0
)
{
++
i_nb_rear
;
}
if
(
p_sys
->
i_rear_right
>=
0
)
if
(
p_sys
->
i_rear_right
>=
0
)
{
++
i_nb_rear
;
}
for
(
i
=
0
;
i
<
i_nb_samples
;
++
i
)
for
(
i
=
0
;
i
<
i_nb_samples
;
++
i
)
{
float
f_left
=
p_in
[
i
*
2
];
float
f_right
=
p_in
[
i
*
2
+
1
];
float
f_rear
=
(
f_left
-
f_right
)
/
i_nb_rear
;
if
(
p_sys
->
i_center
>=
0
)
if
(
p_sys
->
i_center
>=
0
)
{
float
f_center
=
f_left
+
f_right
;
f_left
-=
f_center
/
2
;
...
...
@@ -216,26 +209,25 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
p_out
[
i
*
i_nb_channels
+
p_sys
->
i_center
]
=
f_center
;
}
if
(
p_sys
->
i_left
>=
0
)
if
(
p_sys
->
i_left
>=
0
)
{
p_out
[
i
*
i_nb_channels
+
p_sys
->
i_left
]
=
f_left
;
}
if
(
p_sys
->
i_right
>=
0
)
if
(
p_sys
->
i_right
>=
0
)
{
p_out
[
i
*
i_nb_channels
+
p_sys
->
i_right
]
=
f_right
;
}
if
(
p_sys
->
i_rear_left
>=
0
)
if
(
p_sys
->
i_rear_left
>=
0
)
{
p_out
[
i
*
i_nb_channels
+
p_sys
->
i_rear_left
]
=
f_rear
;
}
if
(
p_sys
->
i_rear_center
>=
0
)
if
(
p_sys
->
i_rear_center
>=
0
)
{
p_out
[
i
*
i_nb_channels
+
p_sys
->
i_rear_center
]
=
f_rear
;
}
if
(
p_sys
->
i_rear_right
>=
0
)
if
(
p_sys
->
i_rear_right
>=
0
)
{
p_out
[
i
*
i_nb_channels
+
p_sys
->
i_rear_right
]
=
f_rear
;
}
}
}
}
modules/audio_filter/channel_mixer/headphone.c
View file @
679039d9
...
...
@@ -470,8 +470,6 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
p_out
=
p_out_buf
->
p_buffer
;
i_out_size
=
p_out_buf
->
i_nb_bytes
;
if
(
p_sys
!=
NULL
)
{
/* Slide the overflow buffer */
p_overflow
=
p_sys
->
p_overflow_buffer
;
i_overflow_size
=
p_sys
->
i_overflow_buffer_size
;
...
...
@@ -544,11 +542,6 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
}
}
}
}
else
{
memset
(
p_out
,
0
,
i_out_size
);
}
}
/*
...
...
@@ -638,13 +631,9 @@ static void CloseFilter( vlc_object_t *p_this )
{
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
if
(
p_filter
->
p_sys
!=
NULL
)
{
free
(
p_filter
->
p_sys
->
p_overflow_buffer
);
free
(
p_filter
->
p_sys
->
p_atomic_operations
);
free
(
p_filter
->
p_sys
);
p_filter
->
p_sys
=
NULL
;
}
}
static
block_t
*
Convert
(
filter_t
*
p_filter
,
block_t
*
p_block
)
...
...
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