mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-23 11:39:49 +00:00
avfilter/af_silenceremove: use input timestamp for timestamp recalculation
This commit is contained in:
parent
231d0c819f
commit
1b262004d3
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user