swr: add some asserts to resample()
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 19 May 2012 15:47:06 +0000 (17:47 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 19 May 2012 17:23:37 +0000 (19:23 +0200)
These check that the internal and input buffers match in format

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libswresample/swresample.c

index 245a85b..d8a066f 100644 (file)
@@ -419,6 +419,10 @@ static int resample(SwrContext *s, AudioData *out_param, int out_count,
     int ret_sum=0;
     int border=0;
 
+    av_assert1(s->in_buffer.ch_count == in_param->ch_count);
+    av_assert1(s->in_buffer.planar   == in_param->planar);
+    av_assert1(s->in_buffer.fmt      == in_param->fmt);
+
     tmp=out=*out_param;
     in =  *in_param;