diff options
author | Nicolas George <nicolas.george@normalesup.org> | 2012-09-12 19:34:21 +0200 |
---|---|---|
committer | Nicolas George <nicolas.george@normalesup.org> | 2012-09-13 12:05:19 +0200 |
commit | b5bea2f96065642e32e172cf57d1f36ac12a4a5d (patch) | |
tree | a985f1b0b2816a02845b6f99d2a54c5db3a82816 | |
parent | ddabecbbf5509325c6c695ccc60d67c0af2065f3 (diff) | |
download | ffmpeg-b5bea2f96065642e32e172cf57d1f36ac12a4a5d.tar.gz |
lavfi/aresample: set buffer properties after copy.
The aresample filter changes the format, layout and/or sample rate,
it can not copy them blindly from its input.
Related to trac ticket #1671.
-rw-r--r-- | libavfilter/af_aresample.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c index 422194508b..f0ccb5fcf8 100644 --- a/libavfilter/af_aresample.c +++ b/libavfilter/af_aresample.c @@ -179,6 +179,9 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref) avfilter_copy_buffer_ref_props(outsamplesref, insamplesref); + outsamplesref->format = outlink->format; + outsamplesref->audio->channel_layout = outlink->channel_layout; + outsamplesref->audio->sample_rate = outlink->sample_rate; if(insamplesref->pts != AV_NOPTS_VALUE) { int64_t inpts = av_rescale(insamplesref->pts, inlink->time_base.num * (int64_t)outlink->sample_rate * inlink->sample_rate, inlink->time_base.den); @@ -197,7 +200,6 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref) return 0; } - outsamplesref->audio->sample_rate = outlink->sample_rate; outsamplesref->audio->nb_samples = n_out; ret = ff_filter_samples(outlink, outsamplesref); |