[FFmpeg-devel] [PATCH 2/2] lavfi/aresample: set buffer properties after copy.

Nicolas George nicolas.george at normalesup.org
Wed Sep 12 19:45:46 CEST 2012


The aresample filter changes the format, layout and/or sample rate,
it can not copy them blindly from its input.

Fix trac ticket 1671 because af_volume uses the properties from the
buffer and not from the link.

Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
---
 libavfilter/af_aresample.c |    3 +++
 1 file changed, 3 insertions(+)


For branch 0.11. I still need to check why it does not happen for git head.


diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c
index 8ead314..90e8781 100644
--- a/libavfilter/af_aresample.c
+++ b/libavfilter/af_aresample.c
@@ -176,6 +176,9 @@ static void 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);
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list