]> git.sesse.net Git - ffmpeg/commitdiff
Change max_framesize for small final frame.
authorJustin Ruggles <justin.ruggles@gmail.com>
Sat, 31 Jul 2010 20:52:33 +0000 (20:52 +0000)
committerJustin Ruggles <justin.ruggles@gmail.com>
Sat, 31 Jul 2010 20:52:33 +0000 (20:52 +0000)
Originally committed as revision 24631 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/flacenc.c

index dc620b10f47e7bf4518d1ea78b3d6bd23e939221..9cd65e9ac0373df268df8761afd77ded8b67f87c 100644 (file)
@@ -1272,6 +1272,12 @@ static int flac_encode_frame(AVCodecContext *avctx, uint8_t *frame,
         return 0;
     }
 
+    /* change max_framesize for small final frame */
+    if (avctx->frame_size < s->frame.blocksize) {
+        s->max_framesize = ff_flac_get_max_frame_size(avctx->frame_size,
+                                                      s->channels, 16);
+    }
+
     init_frame(s);
 
     copy_samples(s, samples);