aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-02-13 20:59:48 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-02-13 20:59:48 +0000
commitcfbd16df75e6eacd9d797b5a06f347c832d6a757 (patch)
treebd40b227ad5d814c6e595aace085f20cd0feae04 /libavcodec/mpegvideo.c
parent80ee9fc0e305b815b4b67bbf8fa9ceccdc1d369e (diff)
downloadffmpeg-cfbd16df75e6eacd9d797b5a06f347c832d6a757.tar.gz
replace a few pbBufPtr() by put_bits_count(), one of them was actually wrong
Originally committed as revision 2774 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index b65b65f3e1..dfb4dd4850 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -2041,7 +2041,7 @@ int MPV_encode_picture(AVCodecContext *avctx,
}
flush_put_bits(&s->pb);
- s->frame_bits = (pbBufPtr(&s->pb) - s->pb.buf) * 8;
+ s->frame_bits = put_bits_count(&s->pb);
stuffing_count= ff_vbv_update(s, s->frame_bits);
if(stuffing_count){
@@ -2064,7 +2064,7 @@ int MPV_encode_picture(AVCodecContext *avctx,
av_log(s->avctx, AV_LOG_ERROR, "vbv buffer overflow\n");
}
flush_put_bits(&s->pb);
- s->frame_bits = (pbBufPtr(&s->pb) - s->pb.buf) * 8;
+ s->frame_bits = put_bits_count(&s->pb);
}
/* update mpeg1/2 vbv_delay for CBR */
@@ -4040,7 +4040,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
if(s->rtp_mode){
int current_packet_size, is_gob_start;
- current_packet_size= pbBufPtr(&s->pb) - s->ptr_lastgob; //FIXME wrong
+ current_packet_size= ((put_bits_count(&s->pb)+7)>>3) - (s->ptr_lastgob - s->pb.buf);
is_gob_start= s->avctx->rtp_payload_size && current_packet_size >= s->avctx->rtp_payload_size && mb_y + mb_x>0;