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
f4fcff7f
Commit
f4fcff7f
authored
Apr 16, 2014
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
audiobargraph_a: cosmetics
parent
5f1fcaaa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
modules/audio_filter/audiobargraph_a.c
modules/audio_filter/audiobargraph_a.c
+8
-10
No files found.
modules/audio_filter/audiobargraph_a.c
View file @
f4fcff7f
...
...
@@ -148,7 +148,7 @@ static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
float
*
p_sample
=
(
float
*
)
p_in_buf
->
p_buffer
;
float
i_value
[
AOUT_CHAN_MAX
];
int
nbChannels
=
aout_FormatNbChannels
(
&
p_filter
->
fmt_in
.
audio
);
int
nbChannels
=
aout_FormatNbChannels
(
&
p_filter
->
fmt_in
.
audio
);
for
(
int
i
=
0
;
i
<
nbChannels
;
i
++
)
i_value
[
i
]
=
0
.;
...
...
@@ -172,16 +172,14 @@ static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
new
->
value
=
max
;
new
->
date
=
p_in_buf
->
i_pts
;
new
->
next
=
NULL
;
if
(
p_sys
->
last
!=
NULL
)
{
if
(
p_sys
->
last
!=
NULL
)
p_sys
->
last
->
next
=
new
;
}
p_sys
->
last
=
new
;
if
(
p_sys
->
first
==
NULL
)
{
if
(
p_sys
->
first
==
NULL
)
p_sys
->
first
=
new
;
}
/* 3 - delete too old values */
while
(
p_sys
->
first
->
date
<
(
new
->
date
-
p_sys
->
time_window
)
)
{
while
(
p_sys
->
first
->
date
<
new
->
date
-
p_sys
->
time_window
)
{
p_sys
->
started
=
1
;
// we have enough values to compute a valid total
ValueDate_t
*
current
=
p_sys
->
first
;
p_sys
->
first
=
p_sys
->
first
->
next
;
...
...
@@ -189,7 +187,7 @@ static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
}
/* If last message was sent enough time ago */
if
(
(
p_sys
->
started
)
&&
(
p_in_buf
->
i_pts
>
p_sys
->
lastAlarm
+
p_sys
->
repetition_time
)
)
{
if
(
p_sys
->
started
&&
p_in_buf
->
i_pts
>
p_sys
->
lastAlarm
+
p_sys
->
repetition_time
)
{
/* 4 - compute the RMS */
ValueDate_t
*
current
=
p_sys
->
first
;
...
...
@@ -221,18 +219,18 @@ static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
if
(
p_sys
->
bargraph
)
{
/* 6 - sent the message with the values for the BarGraph */
if
(
(
nbChannels
>
0
)
&&
(
p_sys
->
counter
%
(
p_sys
->
bargraph_repetition
)
==
0
)
)
{
if
(
nbChannels
>
0
&&
p_sys
->
counter
%
p_sys
->
bargraph_repetition
==
0
)
{
char
message
[
256
];
size_t
j
=
0
;
for
(
int
i
=
0
;
i
<
nbChannels
;
i
++
)
{
if
(
j
>=
sizeof
(
message
))
if
(
j
>=
sizeof
(
message
))
break
;
j
+=
snprintf
(
message
+
j
,
sizeof
(
message
),
"%f:"
,
i_value
[
i
]);
}
message
[
--
j
]
=
'\0'
;
msg_Dbg
(
p_filter
,
"values: %s"
,
message
);
msg_Dbg
(
p_filter
,
"values: %s"
,
message
);
var_SetString
(
p_filter
->
p_libvlc
,
"audiobargraph_v-i_values"
,
message
);
...
...
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