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
a9121588
Commit
a9121588
authored
Jul 14, 2010
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved AoutChangeFilterString out of aout_internal.h.
No functionnal changes.
parent
a4f30ff9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
70 additions
and
69 deletions
+70
-69
src/audio_output/aout_internal.h
src/audio_output/aout_internal.h
+1
-66
src/audio_output/common.c
src/audio_output/common.c
+66
-0
src/audio_output/input.c
src/audio_output/input.c
+2
-2
src/audio_output/intf.c
src/audio_output/intf.c
+1
-1
No files found.
src/audio_output/aout_internal.h
View file @
a9121588
...
...
@@ -142,7 +142,7 @@ void aout_FifoSet( aout_instance_t *, aout_fifo_t *, mtime_t );
void
aout_FifoMoveDates
(
aout_instance_t
*
,
aout_fifo_t
*
,
mtime_t
);
void
aout_FifoDestroy
(
aout_instance_t
*
p_aout
,
aout_fifo_t
*
p_fifo
);
void
aout_FormatsPrint
(
aout_instance_t
*
p_aout
,
const
char
*
psz_text
,
const
audio_sample_format_t
*
p_format1
,
const
audio_sample_format_t
*
p_format2
);
bool
aout_ChangeFilterString
(
vlc_object_t
*
,
aout_instance_t
*
,
const
char
*
psz_variable
,
const
char
*
psz_name
,
bool
b_add
);
/* From intf.c :*/
int
aout_VolumeSoftGet
(
aout_instance_t
*
,
audio_volume_t
*
);
...
...
@@ -266,69 +266,4 @@ static inline void AoutInputsMarkToRestart( aout_instance_t *p_aout )
aout_unlock_mixer
(
p_aout
);
}
/* This function will add or remove a a module from a string list (colon
* separated). It will return true if there is a modification
* In case p_aout is NULL, we will use configuration instead of variable */
static
inline
bool
AoutChangeFilterString
(
vlc_object_t
*
p_obj
,
aout_instance_t
*
p_aout
,
const
char
*
psz_variable
,
const
char
*
psz_name
,
bool
b_add
)
{
char
*
psz_val
;
char
*
psz_parser
;
if
(
*
psz_name
==
'\0'
)
return
false
;
if
(
p_aout
)
psz_val
=
var_GetString
(
p_aout
,
psz_variable
);
else
{
psz_val
=
var_CreateGetString
(
p_obj
->
p_libvlc
,
"audio-filter"
);
var_Destroy
(
p_obj
->
p_libvlc
,
"audio-filter"
);
}
if
(
!
psz_val
)
psz_val
=
strdup
(
""
);
psz_parser
=
strstr
(
psz_val
,
psz_name
);
if
(
(
b_add
&&
psz_parser
)
||
(
!
b_add
&&
!
psz_parser
)
)
{
/* Nothing to do */
free
(
psz_val
);
return
false
;
}
if
(
b_add
)
{
char
*
psz_old
=
psz_val
;
if
(
*
psz_old
)
{
if
(
asprintf
(
&
psz_val
,
"%s:%s"
,
psz_old
,
psz_name
)
==
-
1
)
psz_val
=
NULL
;
}
else
psz_val
=
strdup
(
psz_name
);
free
(
psz_old
);
}
else
{
const
int
i_name
=
strlen
(
psz_name
);
const
char
*
psz_next
;
psz_next
=
&
psz_parser
[
i_name
];
if
(
*
psz_next
==
':'
)
psz_next
++
;
memmove
(
psz_parser
,
psz_next
,
strlen
(
psz_next
)
+
1
);
}
if
(
p_aout
)
var_SetString
(
p_aout
,
psz_variable
,
psz_val
);
else
config_PutPsz
(
p_obj
,
psz_variable
,
psz_val
);
free
(
psz_val
);
return
true
;
}
#endif
/* !__LIBVLC_AOUT_INTERNAL_H */
src/audio_output/common.c
View file @
a9121588
...
...
@@ -774,3 +774,69 @@ aout_buffer_t *aout_BufferAlloc(aout_alloc_t *allocation, mtime_t microseconds,
return
block_Alloc
(
i_alloc_size
);
}
/* This function will add or remove a a module from a string list (colon
* separated). It will return true if there is a modification
* In case p_aout is NULL, we will use configuration instead of variable */
bool
aout_ChangeFilterString
(
vlc_object_t
*
p_obj
,
aout_instance_t
*
p_aout
,
const
char
*
psz_variable
,
const
char
*
psz_name
,
bool
b_add
)
{
char
*
psz_val
;
char
*
psz_parser
;
if
(
*
psz_name
==
'\0'
)
return
false
;
if
(
p_aout
)
psz_val
=
var_GetString
(
p_aout
,
psz_variable
);
else
{
psz_val
=
var_CreateGetString
(
p_obj
->
p_libvlc
,
"audio-filter"
);
var_Destroy
(
p_obj
->
p_libvlc
,
"audio-filter"
);
}
if
(
!
psz_val
)
psz_val
=
strdup
(
""
);
psz_parser
=
strstr
(
psz_val
,
psz_name
);
if
(
(
b_add
&&
psz_parser
)
||
(
!
b_add
&&
!
psz_parser
)
)
{
/* Nothing to do */
free
(
psz_val
);
return
false
;
}
if
(
b_add
)
{
char
*
psz_old
=
psz_val
;
if
(
*
psz_old
)
{
if
(
asprintf
(
&
psz_val
,
"%s:%s"
,
psz_old
,
psz_name
)
==
-
1
)
psz_val
=
NULL
;
}
else
psz_val
=
strdup
(
psz_name
);
free
(
psz_old
);
}
else
{
const
int
i_name
=
strlen
(
psz_name
);
const
char
*
psz_next
;
psz_next
=
&
psz_parser
[
i_name
];
if
(
*
psz_next
==
':'
)
psz_next
++
;
memmove
(
psz_parser
,
psz_next
,
strlen
(
psz_next
)
+
1
);
}
if
(
p_aout
)
var_SetString
(
p_aout
,
psz_variable
,
psz_val
);
else
config_PutPsz
(
p_obj
,
psz_variable
,
psz_val
);
free
(
psz_val
);
return
true
;
}
src/audio_output/input.c
View file @
a9121588
...
...
@@ -843,8 +843,8 @@ vout_thread_t *aout_filter_RequestVout( filter_t *p_filter,
static
int
ChangeFiltersString
(
aout_instance_t
*
p_aout
,
const
char
*
psz_variable
,
const
char
*
psz_name
,
bool
b_add
)
{
return
Aout
ChangeFilterString
(
VLC_OBJECT
(
p_aout
),
p_aout
,
psz_variable
,
psz_name
,
b_add
)
?
1
:
0
;
return
aout_
ChangeFilterString
(
VLC_OBJECT
(
p_aout
),
p_aout
,
psz_variable
,
psz_name
,
b_add
)
?
1
:
0
;
}
static
int
VisualizationCallback
(
vlc_object_t
*
p_this
,
char
const
*
psz_cmd
,
...
...
src/audio_output/intf.c
View file @
a9121588
...
...
@@ -512,7 +512,7 @@ void aout_EnableFilter( vlc_object_t *p_this, const char *psz_name,
{
aout_instance_t
*
p_aout
=
findAout
(
p_this
);
if
(
Aout
ChangeFilterString
(
p_this
,
p_aout
,
"audio-filter"
,
psz_name
,
b_add
)
)
if
(
aout_
ChangeFilterString
(
p_this
,
p_aout
,
"audio-filter"
,
psz_name
,
b_add
)
)
{
if
(
p_aout
)
AoutInputsMarkToRestart
(
p_aout
);
...
...
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