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
066f2cd5
Commit
066f2cd5
authored
Apr 16, 2014
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
audiobargraph_v: simplify parse_i_values
parent
d9bf3484
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
modules/video_filter/audiobargraph_v.c
modules/video_filter/audiobargraph_v.c
+4
-6
No files found.
modules/video_filter/audiobargraph_v.c
View file @
066f2cd5
...
...
@@ -182,23 +182,21 @@ static float iec_scale(float dB)
*****************************************************************************/
static
void
parse_i_values
(
BarGraph_t
*
p_BarGraph
,
char
*
i_values
)
{
char
*
res
=
NULL
;
char
delim
[]
=
":"
;
char
*
tok
;
float
db
;
p_BarGraph
->
nbChannels
=
0
;
free
(
p_BarGraph
->
i_values
);
p_BarGraph
->
i_values
=
NULL
;
res
=
strtok_r
(
i_values
,
delim
,
&
tok
);
char
*
res
=
strtok_r
(
i_values
,
delim
,
&
tok
);
while
(
res
!=
NULL
)
{
p_BarGraph
->
nbChannels
++
;
p_BarGraph
->
i_values
=
xrealloc
(
p_BarGraph
->
i_values
,
p_BarGraph
->
nbChannels
*
sizeof
(
int
));
db
=
log10
(
atof
(
res
))
*
20
;
float
db
=
log10
(
atof
(
res
))
*
20
;
p_BarGraph
->
i_values
[
p_BarGraph
->
nbChannels
-
1
]
=
VLC_CLIP
(
iec_scale
(
db
)
*
p_BarGraph
->
scale
,
0
,
p_BarGraph
->
scale
);
res
=
strtok_r
(
NULL
,
delim
,
&
tok
);
}
}
/*****************************************************************************
...
...
@@ -589,7 +587,6 @@ static int BarGraphCallback(vlc_object_t *p_this, char const *psz_var,
p_BarGraph
->
i_alpha
=
VLC_CLIP
(
newval
.
i_int
,
0
,
255
);
else
if
(
!
strcmp
(
psz_var
,
"audiobargraph_v-i_values"
))
{
char
*
psz
=
xstrdup
(
newval
.
psz_string
?
newval
.
psz_string
:
""
);
free
(
p_BarGraph
->
i_values
);
// in case many answer are received at the same time, only keep one
res
=
strchr
(
psz
,
'@'
);
if
(
res
)
...
...
@@ -788,6 +785,7 @@ static int OpenCommon(vlc_object_t *p_this, bool b_sub)
p_BarGraph
->
i_alpha
=
var_CreateGetIntegerCommand
(
p_filter
,
"audiobargraph_v-transparency"
);
p_BarGraph
->
i_alpha
=
VLC_CLIP
(
p_BarGraph
->
i_alpha
,
0
,
255
);
p_BarGraph
->
i_values
=
NULL
;
parse_i_values
(
p_BarGraph
,
&
(
char
){
0
});
p_BarGraph
->
alarm
=
false
;
...
...
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