[FFmpeg-cvslog] lavfi/aresample: set buffer properties after copy.

Nicolas George git at videolan.org
Thu Sep 13 12:03:57 CEST 2012


ffmpeg | branch: release/0.11 | Nicolas George <nicolas.george at normalesup.org> | Wed Sep 12 19:34:21 2012 +0200| [05e64b51bba71ee821adaa7f75a5161455bb972f] | committer: Nicolas George

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.

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

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=05e64b51bba71ee821adaa7f75a5161455bb972f
---

 libavfilter/af_aresample.c |    3 +++
 1 file changed, 3 insertions(+)

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);



More information about the ffmpeg-cvslog mailing list