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
350bbcd3
Commit
350bbcd3
authored
Oct 03, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dolby mixer: audio filter2
parent
98632dae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
18 deletions
+19
-18
modules/audio_filter/channel_mixer/dolby.c
modules/audio_filter/channel_mixer/dolby.c
+19
-18
No files found.
modules/audio_filter/channel_mixer/dolby.c
View file @
350bbcd3
...
...
@@ -32,6 +32,7 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_aout.h>
#include <vlc_filter.h>
/*****************************************************************************
* Local prototypes
...
...
@@ -39,8 +40,7 @@
static
int
Create
(
vlc_object_t
*
);
static
void
Destroy
(
vlc_object_t
*
);
static
void
DoWork
(
aout_instance_t
*
,
aout_filter_t
*
,
aout_buffer_t
*
,
aout_buffer_t
*
);
static
block_t
*
DoWork
(
filter_t
*
,
block_t
*
);
/*****************************************************************************
* Module descriptor
...
...
@@ -50,14 +50,14 @@ vlc_module_begin ()
set_shortname
(
N_
(
"Dolby Surround decoder"
)
)
set_category
(
CAT_INPUT
)
set_subcategory
(
SUBCAT_INPUT_ACODEC
)
set_capability
(
"audio filter"
,
5
)
set_capability
(
"audio filter
2
"
,
5
)
set_callbacks
(
Create
,
Destroy
)
vlc_module_end
()
/*****************************************************************************
* Internal data structures
*****************************************************************************/
struct
aout_
filter_sys_t
struct
filter_sys_t
{
int
i_left
;
int
i_center
;
...
...
@@ -80,8 +80,8 @@ static int Create( vlc_object_t *p_this )
{
int
i
=
0
;
int
i_offset
=
0
;
aout_filter_t
*
p_filter
=
(
aout_
filter_t
*
)
p_this
;
aout_
filter_sys_t
*
p_sys
;
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
filter_sys_t
*
p_sys
;
/* Validate audio filter format */
if
(
p_filter
->
fmt_in
.
audio
.
i_physical_channels
!=
(
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
)
...
...
@@ -105,7 +105,7 @@ static int Create( vlc_object_t *p_this )
}
/* Allocate the memory needed to store the module's structure */
p_sys
=
p_filter
->
p_sys
=
malloc
(
sizeof
(
struct
aout_filter_sys_t
)
);
p_sys
=
p_filter
->
p_sys
=
malloc
(
sizeof
(
*
p_sys
)
);
if
(
p_sys
==
NULL
)
return
VLC_ENOMEM
;
p_sys
->
i_left
=
-
1
;
...
...
@@ -145,8 +145,7 @@ static int Create( vlc_object_t *p_this )
++
i
;
}
p_filter
->
pf_do_work
=
DoWork
;
p_filter
->
b_in_place
=
0
;
p_filter
->
pf_audio_filter
=
DoWork
;
return
VLC_SUCCESS
;
}
...
...
@@ -156,31 +155,30 @@ 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
;
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
free
(
p_filter
->
p_sys
);
}
/*****************************************************************************
* DoWork: convert a buffer
*****************************************************************************/
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
)
static
block_t
*
DoWork
(
filter_t
*
p_filter
,
block_t
*
p_in_buf
)
{
VLC_UNUSED
(
p_aout
);
aout_filter_sys_t
*
p_sys
=
p_filter
->
p_sys
;
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
->
fmt_out
.
audio
);
size_t
i_nb_rear
=
0
;
size_t
i
;
block_t
*
p_out_buf
=
filter_NewAudioBuffer
(
p_filter
,
sizeof
(
float
)
*
i_nb_samples
*
i_nb_channels
);
if
(
!
p_out_buf
)
goto
out
;
float
*
p_out
=
(
float
*
)
p_out_buf
->
p_buffer
;
p_out_buf
->
i_nb_samples
=
i_nb_samples
;
p_out_buf
->
i_buffer
=
sizeof
(
float
)
*
i_nb_samples
*
aout_FormatNbChannels
(
&
p_filter
->
fmt_out
.
audio
);
memset
(
p_out
,
0
,
p_out_buf
->
i_buffer
);
if
(
p_sys
->
i_rear_left
>=
0
)
{
++
i_nb_rear
;
...
...
@@ -230,4 +228,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
p_out
[
i
*
i_nb_channels
+
p_sys
->
i_rear_right
]
=
f_rear
;
}
}
out:
block_Release
(
p_in_buf
);
return
p_out_buf
;
}
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