Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
273fca9a
Commit
273fca9a
authored
Oct 20, 2012
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/silencedetect: increase duration precision.
This should also fix CID717889.
parent
99a52000
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
af_silencedetect.c
libavfilter/af_silencedetect.c
+4
-4
No files found.
libavfilter/af_silencedetect.c
View file @
273fca9a
...
...
@@ -35,7 +35,7 @@ typedef struct {
const
AVClass
*
class
;
char
*
noise_str
;
///< noise option string
double
noise
;
///< noise amplitude ratio
int
duration
;
///< minimum duration of silence until notification
double
duration
;
///< minimum duration of silence until notification
int64_t
nb_null_samples
;
///< current number of continuous zero samples
int64_t
start
;
///< if silence is detected, this value contains the time of the first zero sample
int
last_sample_rate
;
///< last sample rate to check for sample rate changes
...
...
@@ -46,8 +46,8 @@ typedef struct {
static
const
AVOption
silencedetect_options
[]
=
{
{
"n"
,
"set noise tolerance"
,
OFFSET
(
noise_str
),
AV_OPT_TYPE_STRING
,
{.
str
=
"-60dB"
},
CHAR_MIN
,
CHAR_MAX
,
FLAGS
},
{
"noise"
,
"set noise tolerance"
,
OFFSET
(
noise_str
),
AV_OPT_TYPE_STRING
,
{.
str
=
"-60dB"
},
CHAR_MIN
,
CHAR_MAX
,
FLAGS
},
{
"d"
,
"set minimum duration in seconds"
,
OFFSET
(
duration
),
AV_OPT_TYPE_
INT
,
{.
i64
=
2
},
0
,
INT_MAX
,
FLAGS
},
{
"duration"
,
"set minimum duration in seconds"
,
OFFSET
(
duration
),
AV_OPT_TYPE_
INT
,
{.
i64
=
2
},
0
,
INT_MAX
,
FLAGS
},
{
"d"
,
"set minimum duration in seconds"
,
OFFSET
(
duration
),
AV_OPT_TYPE_
DOUBLE
,
{.
dbl
=
2
.},
0
,
24
*
60
*
60
,
FLAGS
},
{
"duration"
,
"set minimum duration in seconds"
,
OFFSET
(
duration
),
AV_OPT_TYPE_
DOUBLE
,
{.
dbl
=
2
.},
0
,
24
*
60
*
60
,
FLAGS
},
{
NULL
},
};
...
...
@@ -102,7 +102,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples)
if
(
!
silence
->
start
)
{
silence
->
nb_null_samples
++
;
if
(
silence
->
nb_null_samples
>=
nb_samples_notify
)
{
silence
->
start
=
insamples
->
pts
-
silence
->
duration
/
av_q2d
(
inlink
->
time_base
);
silence
->
start
=
insamples
->
pts
-
(
int64_t
)(
silence
->
duration
/
av_q2d
(
inlink
->
time_base
)
+
.
5
);
av_log
(
silence
,
AV_LOG_INFO
,
"silence_start: %s
\n
"
,
av_ts2timestr
(
silence
->
start
,
&
inlink
->
time_base
));
}
...
...
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