--- ffmpeg2theora-0.29/src/ffmpeg2theora.c.0000	2012-01-29 16:00:19.000000000 +0800
+++ ffmpeg2theora-0.29/src/ffmpeg2theora.c	2013-07-12 17:55:12.561372785 +0800
@@ -1068,8 +1068,8 @@
         int first = 1;
         int audio_eos = 0, video_eos = 0, audio_done = 0, video_done = 0;
         int ret;
-        int16_t *audio_buf=av_malloc(4*AVCODEC_MAX_AUDIO_FRAME_SIZE);
-        int16_t *resampled=av_malloc(4*AVCODEC_MAX_AUDIO_FRAME_SIZE);
+        int16_t *audio_buf=av_malloc(4*192000);
+        int16_t *resampled=av_malloc(4*192000);
         int16_t *audio_p=NULL;
         int no_frames;
         int no_samples;
@@ -1530,7 +1530,7 @@
                 while((audio_eos && !audio_done) || avpkt.size > 0 ) {
                     int samples=0;
                     int samples_out=0;
-                    int data_size = 4*AVCODEC_MAX_AUDIO_FRAME_SIZE;
+                    int data_size = 4*192000;
                     int bytes_per_sample = av_get_bytes_per_sample(aenc->sample_fmt);
 
                     if (avpkt.size > 0) {
