[FFmpeg-cvslog] swresample/swresample: Fix input channel count in resample_first computation

Michael Niedermayer git at videolan.org
Tue Nov 20 18:39:16 EET 2018


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Tue Jul 24 22:44:12 2018 +0200| [83ffda78ddb1f8f44fe964551bc27355b4a3a695] | committer: Michael Niedermayer

swresample/swresample: Fix input channel count in resample_first computation

Found-by: Marcin Gorzel <gorzel at google.com>
Reviewed-by: Marcin Gorzel <gorzel at google.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit bce4da85e8110b66040a5fb07ffc724ab4e09a86)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libswresample/swresample.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libswresample/swresample.c b/libswresample/swresample.c
index 47d4f0dd0b..54180e220c 100644
--- a/libswresample/swresample.c
+++ b/libswresample/swresample.c
@@ -316,7 +316,7 @@ av_cold int swr_init(struct SwrContext *s){
 
 av_assert0(s->used_ch_count);
 av_assert0(s->out.ch_count);
-    s->resample_first= RSC*s->out.ch_count/s->in.ch_count - RSC < s->out_sample_rate/(float)s-> in_sample_rate - 1.0;
+    s->resample_first= RSC*s->out.ch_count/s->used_ch_count - RSC < s->out_sample_rate/(float)s-> in_sample_rate - 1.0;
 
     s->in_buffer= s->in;
     s->silence  = s->in;



More information about the ffmpeg-cvslog mailing list