]> git.sesse.net Git - ffmpeg/commitdiff
swr: realloc_audio: support packed audio buffers
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 25 Mar 2012 19:50:00 +0000 (21:50 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 25 Mar 2012 19:50:00 +0000 (21:50 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libswresample/swresample.c

index a1dcf2a203ac090d36d85aa85f1b7e3c57771ece..9b1647d6075363e1d4c72db7d63fe07fa3052219 100644 (file)
@@ -296,7 +296,6 @@ static int realloc_audio(AudioData *a, int count){
     countb= FFALIGN(count*a->bps, 32);
     old= *a;
 
-    av_assert0(a->planar);
     av_assert0(a->bps);
     av_assert0(a->ch_count);
 
@@ -307,6 +306,7 @@ static int realloc_audio(AudioData *a, int count){
         a->ch[i]= a->data + i*(a->planar ? countb : a->bps);
         if(a->planar) memcpy(a->ch[i], old.ch[i], a->count*a->bps);
     }
+    if(!a->planar) memcpy(a->ch[0], old.ch[0], a->count*a->ch_count*a->bps);
     av_free(old.data);
     a->count= count;