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
e7c8efb8
Commit
e7c8efb8
authored
Apr 26, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aout: clean up filters handling of vout request
parent
5576aaac
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
16 deletions
+15
-16
src/audio_output/dec.c
src/audio_output/dec.c
+3
-4
src/audio_output/filters.c
src/audio_output/filters.c
+12
-12
No files found.
src/audio_output/dec.c
View file @
e7c8efb8
...
...
@@ -78,6 +78,7 @@ int aout_DecNew( audio_output_t *p_aout,
atomic_store
(
&
owner
->
restart
,
0
);
owner
->
input_format
=
*
p_format
;
owner
->
mixer_format
=
owner
->
input_format
;
owner
->
request_vout
=
*
p_request_vout
;
if
(
aout_OutputNew
(
p_aout
,
&
owner
->
mixer_format
))
goto
error
;
...
...
@@ -85,7 +86,7 @@ int aout_DecNew( audio_output_t *p_aout,
/* Create the audio filtering "input" pipeline */
owner
->
filters
=
aout_FiltersNew
(
p_aout
,
p_format
,
&
owner
->
mixer_format
,
p_
request_vout
);
&
owner
->
request_vout
);
if
(
owner
->
filters
==
NULL
)
{
aout_OutputDelete
(
p_aout
);
...
...
@@ -129,8 +130,6 @@ static int aout_CheckReady (audio_output_t *aout)
int
restart
=
atomic_exchange
(
&
owner
->
restart
,
0
);
if
(
unlikely
(
restart
))
{
const
aout_request_vout_t
request_vout
=
owner
->
request_vout
;
if
(
owner
->
mixer_format
.
i_format
)
aout_FiltersDelete
(
aout
,
owner
->
filters
);
...
...
@@ -154,7 +153,7 @@ static int aout_CheckReady (audio_output_t *aout)
{
owner
->
filters
=
aout_FiltersNew
(
aout
,
&
owner
->
input_format
,
&
owner
->
mixer_format
,
&
request_vout
);
&
owner
->
request_vout
);
if
(
owner
->
filters
==
NULL
)
{
aout_OutputDelete
(
aout
);
...
...
src/audio_output/filters.c
View file @
e7c8efb8
...
...
@@ -43,7 +43,7 @@
#include "aout_internal.h"
static
filter_t
*
CreateFilter
(
vlc_object_t
*
obj
,
const
char
*
type
,
const
char
*
name
,
const
char
*
name
,
filter_owner_sys_t
*
owner
,
const
audio_sample_format_t
*
infmt
,
const
audio_sample_format_t
*
outfmt
)
{
...
...
@@ -51,7 +51,7 @@ static filter_t *CreateFilter (vlc_object_t *obj, const char *type,
if
(
unlikely
(
filter
==
NULL
))
return
NULL
;
/*filter->p_owner not set here */
filter
->
p_owner
=
owner
;
filter
->
fmt_in
.
audio
=
*
infmt
;
filter
->
fmt_in
.
i_codec
=
infmt
->
i_format
;
filter
->
fmt_out
.
audio
=
*
outfmt
;
...
...
@@ -74,14 +74,14 @@ static filter_t *FindConverter (vlc_object_t *obj,
const
audio_sample_format_t
*
infmt
,
const
audio_sample_format_t
*
outfmt
)
{
return
CreateFilter
(
obj
,
"audio converter"
,
NULL
,
infmt
,
outfmt
);
return
CreateFilter
(
obj
,
"audio converter"
,
NULL
,
NULL
,
infmt
,
outfmt
);
}
static
filter_t
*
FindResampler
(
vlc_object_t
*
obj
,
const
audio_sample_format_t
*
infmt
,
const
audio_sample_format_t
*
outfmt
)
{
return
CreateFilter
(
obj
,
"audio resampler"
,
"$audio-resampler"
,
return
CreateFilter
(
obj
,
"audio resampler"
,
"$audio-resampler"
,
NULL
,
infmt
,
outfmt
);
}
...
...
@@ -332,19 +332,19 @@ static int EqualizerCallback (vlc_object_t *obj, const char *var,
vout_thread_t
*
aout_filter_RequestVout
(
filter_t
*
filter
,
vout_thread_t
*
vout
,
video_format_t
*
fmt
)
{
/* NOTE: This only works from a
udio outpu
t.
/* NOTE: This only works from a
out_filters_
t.
* If you want to use visualization filters from another place, you will
* need to add a new pf_aout_request_vout callback or store a pointer
* to aout_request_vout_t inside filter_t (i.e. a level of indirection). */
aout_owner_t
*
owner
=
aout_owner
((
audio_output_t
*
)
filter
->
p_parent
);
aout_request_vout_t
*
req
=
&
owner
->
request_vout
;
const
aout_request_vout_t
*
req
=
(
void
*
)
filter
->
p_owner
;
return
req
->
pf_request_vout
(
req
->
p_private
,
vout
,
fmt
,
owner
->
recycle_vout
);
}
static
int
AppendFilter
(
vlc_object_t
*
obj
,
const
char
*
type
,
const
char
*
name
,
aout_filters_t
*
restrict
filters
,
aout_filters_t
*
restrict
filters
,
const
void
*
owner
,
audio_sample_format_t
*
restrict
infmt
,
const
audio_sample_format_t
*
restrict
outfmt
)
{
...
...
@@ -355,7 +355,8 @@ static int AppendFilter(vlc_object_t *obj, const char *type, const char *name,
return
-
1
;
}
filter_t
*
filter
=
CreateFilter
(
obj
,
type
,
name
,
infmt
,
outfmt
);
filter_t
*
filter
=
CreateFilter
(
obj
,
type
,
name
,
(
void
*
)
owner
,
infmt
,
outfmt
);
if
(
filter
==
NULL
)
{
msg_Err
(
obj
,
"cannot add user %s
\"
%s
\"
(skipped)"
,
type
,
name
);
...
...
@@ -428,7 +429,7 @@ aout_filters_t *aout_FiltersNew (audio_output_t *aout,
if
(
var_InheritBool
(
aout
,
"audio-time-stretch"
))
{
if
(
AppendFilter
(
VLC_OBJECT
(
aout
),
"audio filter"
,
"scaletempo"
,
filters
,
&
input_format
,
&
output_format
)
==
0
)
filters
,
NULL
,
&
input_format
,
&
output_format
)
==
0
)
filters
->
rate_filter
=
filters
->
tab
[
filters
->
count
-
1
];
}
...
...
@@ -439,18 +440,17 @@ aout_filters_t *aout_FiltersNew (audio_output_t *aout,
while
((
name
=
strsep
(
&
p
,
" :"
))
!=
NULL
)
{
AppendFilter
(
VLC_OBJECT
(
aout
),
"audio filter"
,
name
,
filters
,
&
input_format
,
&
output_format
);
NULL
,
&
input_format
,
&
output_format
);
}
free
(
str
);
}
char
*
visual
=
var_InheritString
(
aout
,
"audio-visual"
);
owner
->
request_vout
=
*
request_vout
;
owner
->
recycle_vout
=
visual
!=
NULL
;
if
(
visual
!=
NULL
&&
strcasecmp
(
visual
,
"none"
))
{
AppendFilter
(
VLC_OBJECT
(
aout
),
"visualization"
,
visual
,
filters
,
&
input_format
,
&
output_format
);
request_vout
,
&
input_format
,
&
output_format
);
}
free
(
visual
);
...
...
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