X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Faf_silenceremove.c;h=7dd8c5a1d81ea48c696bc3d04b429b5b4d80c143;hb=930391e5988abe126d29c5e9b09fab459e0b8936;hp=335f55bb4e9d858b91efb6cf6b93e37843f650db;hpb=e4e04dce1fab81bcdef82e60184d50c73d212c6a;p=ffmpeg diff --git a/libavfilter/af_silenceremove.c b/libavfilter/af_silenceremove.c index 335f55bb4e9..7dd8c5a1d81 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: