aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2021-09-09 20:20:13 +0200
committerPaul B Mahol <onemda@gmail.com>2021-09-09 20:22:02 +0200
commitabd24eaf688d4987c75be0816abf5eb49ccaa28f (patch)
tree18b9dabf8010600d3fb9276c501c307e9f133c5e
parent3bbe0c210b05fc6fbd7b1d4bbd8479db7f2cf957 (diff)
downloadffmpeg-abd24eaf688d4987c75be0816abf5eb49ccaa28f.tar.gz
avfilter/af_silenceremove: fix regression in output frame pts
-rw-r--r--libavfilter/af_silenceremove.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/libavfilter/af_silenceremove.c b/libavfilter/af_silenceremove.c
index 6f3250bbb1..e8e79e93f4 100644
--- a/libavfilter/af_silenceremove.c
+++ b/libavfilter/af_silenceremove.c
@@ -561,11 +561,6 @@ static void flush(SilenceRemoveContext *s,
if (*nb_samples_written) {
out->nb_samples = *nb_samples_written;
- out->pts = s->next_pts;
- s->next_pts += av_rescale_q(out->nb_samples,
- (AVRational){1, outlink->sample_rate},
- outlink->time_base);
-
av_audio_fifo_write(s->fifo, (void **)out->extended_data, out->nb_samples);
*nb_samples_written = 0;
}
@@ -596,11 +591,6 @@ static void flush(SilenceRemoveContext *s,
s->stop_silence_offset = 0;
s->stop_silence_end = 0;
- silence->pts = s->next_pts;
- s->next_pts += av_rescale_q(silence->nb_samples,
- (AVRational){1, outlink->sample_rate},
- outlink->time_base);
-
av_audio_fifo_write(s->fifo, (void **)silence->extended_data, silence->nb_samples);
av_frame_free(&silence);
}
@@ -724,11 +714,6 @@ silence_trim_flush:
s->start_holdoff_offset, nbs,
outlink->channels, outlink->format);
- out->pts = s->next_pts;
- s->next_pts += av_rescale_q(out->nb_samples,
- (AVRational){1, outlink->sample_rate},
- outlink->time_base);
-
s->start_holdoff_offset += nbs;
av_audio_fifo_write(s->fifo, (void **)out->extended_data, out->nb_samples);
@@ -848,11 +833,6 @@ silence_copy:
nb_samples_read, nbs,
outlink->channels, outlink->format);
- out->pts = s->next_pts;
- s->next_pts += av_rescale_q(out->nb_samples,
- (AVRational){1, outlink->sample_rate},
- outlink->time_base);
-
av_audio_fifo_write(s->fifo, (void **)out->extended_data, out->nb_samples);
av_frame_free(&out);
}
@@ -876,11 +856,6 @@ silence_copy_flush:
s->stop_holdoff_offset += nbs;
- out->pts = s->next_pts;
- s->next_pts += av_rescale_q(out->nb_samples,
- (AVRational){1, outlink->sample_rate},
- outlink->time_base);
-
av_audio_fifo_write(s->fifo, (void **)out->extended_data, out->nb_samples);
av_frame_free(&out);
@@ -909,6 +884,10 @@ silence_stop:
av_audio_fifo_read(s->fifo, (void **)out->extended_data, out->nb_samples);
out->pts = s->next_pts;
+ s->next_pts += av_rescale_q(out->nb_samples,
+ (AVRational){1, outlink->sample_rate},
+ outlink->time_base);
+
ret = ff_filter_frame(outlink, out);
}