summaryrefslogtreecommitdiff
path: root/libavfilter/af_compand.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-02-26 12:44:01 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-02-26 12:46:04 +0100
commit4b879751473227610e28005987176ae64f3cfdd6 (patch)
treeb67da76e142f32fd4ca42d03a568bb179e42287b /libavfilter/af_compand.c
parent5c78fe08b0a67b4c05dc264b14b0d74fc86501bc (diff)
downloadffmpeg-4b879751473227610e28005987176ae64f3cfdd6.tar.gz
avfilter/af_compand: pts init code from libavfilter/af_compand_fork.c
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/af_compand.c')
-rw-r--r--libavfilter/af_compand.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavfilter/af_compand.c b/libavfilter/af_compand.c
index 5080ff709c..5ad0f49d7a 100644
--- a/libavfilter/af_compand.c
+++ b/libavfilter/af_compand.c
@@ -87,6 +87,7 @@ AVFILTER_DEFINE_CLASS(compand);
static av_cold int init(AVFilterContext *ctx)
{
CompandContext *s = ctx->priv;
+ s->pts = AV_NOPTS_VALUE;
if (!s->attacks || !s->decays || !s->points) {
av_log(ctx, AV_LOG_ERROR, "Missing attacks and/or decays and/or points.\n");
@@ -223,6 +224,10 @@ static int compand_delay(AVFilterContext *ctx, AVFrame *frame)
int chan, i, av_uninit(dindex), oindex, av_uninit(count);
AVFrame *out_frame = NULL;
+ if (s->pts == AV_NOPTS_VALUE) {
+ s->pts = (frame->pts == AV_NOPTS_VALUE) ? 0 : frame->pts;
+ }
+
av_assert1(channels > 0); /* would corrupt delay_count and delay_index */
for (chan = 0; chan < channels; chan++) {