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
5170ab20
Commit
5170ab20
authored
Feb 19, 2018
by
Nicolas Gaullier
Committed by
Paul B Mahol
Mar 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/silencedetect: Fix silence_end accuracy
parent
56b2731a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
af_silencedetect.c
libavfilter/af_silencedetect.c
+2
-1
filter-metadata-silencedetect
tests/ref/fate/filter-metadata-silencedetect
+6
-6
No files found.
libavfilter/af_silencedetect.c
View file @
5170ab20
...
@@ -92,7 +92,8 @@ static av_always_inline void update(SilenceDetectContext *s, AVFrame *insamples,
...
@@ -92,7 +92,8 @@ static av_always_inline void update(SilenceDetectContext *s, AVFrame *insamples,
}
}
}
else
{
}
else
{
if
(
s
->
start
[
channel
]
>
INT64_MIN
)
{
if
(
s
->
start
[
channel
]
>
INT64_MIN
)
{
int64_t
end_pts
=
insamples
->
pts
;
int64_t
end_pts
=
insamples
->
pts
+
av_rescale_q
(
current_sample
/
s
->
channels
,
(
AVRational
){
1
,
s
->
last_sample_rate
},
time_base
);
int64_t
duration_ts
=
end_pts
-
s
->
start
[
channel
];
int64_t
duration_ts
=
end_pts
-
s
->
start
[
channel
];
set_meta
(
insamples
,
s
->
mono
?
channel
+
1
:
0
,
"silence_end"
,
set_meta
(
insamples
,
s
->
mono
?
channel
+
1
:
0
,
"silence_end"
,
av_ts2timestr
(
end_pts
,
&
time_base
));
av_ts2timestr
(
end_pts
,
&
time_base
));
...
...
tests/ref/fate/filter-metadata-silencedetect
View file @
5170ab20
...
@@ -17,7 +17,7 @@ pkt_pts=4800
...
@@ -17,7 +17,7 @@ pkt_pts=4800
pkt_pts=5120
pkt_pts=5120
pkt_pts=5440
pkt_pts=5440
pkt_pts=5760
pkt_pts=5760
pkt_pts=6080|tag:lavfi.silence_end=0.38
|tag:lavfi.silence_duration=0.38
pkt_pts=6080|tag:lavfi.silence_end=0.38
4813|tag:lavfi.silence_duration=0.384813
pkt_pts=6400
pkt_pts=6400
pkt_pts=6720
pkt_pts=6720
pkt_pts=7040
pkt_pts=7040
...
@@ -97,7 +97,7 @@ pkt_pts=30400
...
@@ -97,7 +97,7 @@ pkt_pts=30400
pkt_pts=30720
pkt_pts=30720
pkt_pts=31040
pkt_pts=31040
pkt_pts=31360
pkt_pts=31360
pkt_pts=31680|tag:lavfi.silence_end=1.9
8|tag:lavfi.silence_duration=0.792438
pkt_pts=31680|tag:lavfi.silence_end=1.9
9538|tag:lavfi.silence_duration=0.807813
pkt_pts=32000
pkt_pts=32000
pkt_pts=32320
pkt_pts=32320
pkt_pts=32640
pkt_pts=32640
...
@@ -196,7 +196,7 @@ pkt_pts=62080
...
@@ -196,7 +196,7 @@ pkt_pts=62080
pkt_pts=62400
pkt_pts=62400
pkt_pts=62720
pkt_pts=62720
pkt_pts=63040
pkt_pts=63040
pkt_pts=63360|tag:lavfi.silence_end=3.9
6|tag:lavfi.silence_duration=1.015
pkt_pts=63360|tag:lavfi.silence_end=3.9
7138|tag:lavfi.silence_duration=1.02638
pkt_pts=63680
pkt_pts=63680
pkt_pts=64000
pkt_pts=64000
pkt_pts=64320
pkt_pts=64320
...
@@ -270,7 +270,7 @@ pkt_pts=85760
...
@@ -270,7 +270,7 @@ pkt_pts=85760
pkt_pts=86080
pkt_pts=86080
pkt_pts=86400
pkt_pts=86400
pkt_pts=86720
pkt_pts=86720
pkt_pts=87040|tag:lavfi.silence_end=5.4
4|tag:lavfi.silence_duration=0.68
3375
pkt_pts=87040|tag:lavfi.silence_end=5.4
5|tag:lavfi.silence_duration=0.69
3375
pkt_pts=87360
pkt_pts=87360
pkt_pts=87680
pkt_pts=87680
pkt_pts=88000
pkt_pts=88000
...
@@ -362,7 +362,7 @@ pkt_pts=115200
...
@@ -362,7 +362,7 @@ pkt_pts=115200
pkt_pts=115520
pkt_pts=115520
pkt_pts=115840
pkt_pts=115840
pkt_pts=116160
pkt_pts=116160
pkt_pts=116480|tag:lavfi.silence_end=7.28
|tag:lavfi.silence_duration=1.00681
pkt_pts=116480|tag:lavfi.silence_end=7.28
569|tag:lavfi.silence_duration=1.0125
pkt_pts=116800
pkt_pts=116800
pkt_pts=117120
pkt_pts=117120
pkt_pts=117440
pkt_pts=117440
...
@@ -452,7 +452,7 @@ pkt_pts=144000
...
@@ -452,7 +452,7 @@ pkt_pts=144000
pkt_pts=144320
pkt_pts=144320
pkt_pts=144640
pkt_pts=144640
pkt_pts=144960
pkt_pts=144960
pkt_pts=145280|tag:lavfi.silence_end=9.08
|tag:lavfi.silence_duration=0.828937
pkt_pts=145280|tag:lavfi.silence_end=9.08
156|tag:lavfi.silence_duration=0.8305
pkt_pts=145600
pkt_pts=145600
pkt_pts=145920
pkt_pts=145920
pkt_pts=146240
pkt_pts=146240
...
...
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