diff options
author | Paul B Mahol <onemda@gmail.com> | 2019-07-02 18:06:28 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2019-07-02 19:01:42 +0200 |
commit | 1b262004d35a7cec8540fa47a0533dfb12870f95 (patch) | |
tree | fce32b028e381376f2f3cbf064f01b871973aa12 /libavfilter/af_silenceremove.c | |
parent | 231d0c819fe49f14f49c240470dd92f43fe2355c (diff) | |
download | ffmpeg-1b262004d35a7cec8540fa47a0533dfb12870f95.tar.gz |
avfilter/af_silenceremove: use input timestamp for timestamp recalculation
Diffstat (limited to 'libavfilter/af_silenceremove.c')
-rw-r--r-- | libavfilter/af_silenceremove.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavfilter/af_silenceremove.c b/libavfilter/af_silenceremove.c index 335f55bb4e..7dd8c5a1d8 100644 --- a/libavfilter/af_silenceremove.c +++ b/libavfilter/af_silenceremove.c @@ -206,6 +206,7 @@ static int config_input(AVFilterLink *inlink) AVFilterContext *ctx = inlink->dst; SilenceRemoveContext *s = ctx->priv; + s->next_pts = AV_NOPTS_VALUE; s->window_size = FFMAX((inlink->sample_rate * s->window_ratio), 1) * inlink->channels; s->window = av_malloc_array(s->window_size, sizeof(*s->window)); if (!s->window) @@ -328,6 +329,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) nb_samples_read = nb_samples_written = 0; + if (s->next_pts == AV_NOPTS_VALUE) + s->next_pts = in->pts; + switch (s->mode) { case SILENCE_TRIM: silence_trim: |