]> git.sesse.net Git - ffmpeg/commitdiff
lavf/bit: Use pkt->size instead of a constant for G.729 frame size.
authorCarl Eugen Hoyos <ceffmpeg@gmail.com>
Fri, 29 Sep 2017 16:46:44 +0000 (18:46 +0200)
committerCarl Eugen Hoyos <ceffmpeg@gmail.com>
Fri, 29 Sep 2017 16:46:44 +0000 (18:46 +0200)
Makes the code more readable, the muxer may support variable bit-rate in the future.

libavformat/bit.c

index c703412f1c432e476624bc1e1d9ab38cbcd3acef..d742a5b3639bec4360b79c4b8a7139d152e3692d 100644 (file)
@@ -143,10 +143,10 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
         return AVERROR(EINVAL);
 
     avio_wl16(pb, SYNC_WORD);
-    avio_wl16(pb, 8 * 10);
+    avio_wl16(pb, 8 * pkt->size);
 
-    init_get_bits(&gb, pkt->data, 8*10);
-    for(i=0; i< 8 * 10; i++)
+    init_get_bits(&gb, pkt->data, 8 * pkt->size);
+    for (i = 0; i < 8 * pkt->size; i++)
         avio_wl16(pb, get_bits1(&gb) ? BIT_1 : BIT_0);
 
     return 0;