summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/af_silencedetect.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavfilter/af_silencedetect.c b/libavfilter/af_silencedetect.c
index 749c3fbcb7..8973049fe5 100644
--- a/libavfilter/af_silencedetect.c
+++ b/libavfilter/af_silencedetect.c
@@ -92,7 +92,8 @@ static av_always_inline void update(SilenceDetectContext *s, AVFrame *insamples,
}
} else {
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];
set_meta(insamples, s->mono ? channel + 1 : 0, "silence_end",
av_ts2timestr(end_pts, &time_base));