movenc: Simplify code by using avio_wb24
authorMartin Storsjö <martin@martin.st>
Tue, 29 Jan 2013 17:10:04 +0000 (19:10 +0200)
committerMartin Storsjö <martin@martin.st>
Wed, 30 Jan 2013 11:45:45 +0000 (13:45 +0200)
Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/movenc.c

index 3949520..496158c 100644 (file)
@@ -305,8 +305,7 @@ static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track) // Basic
     else
         avio_w8(pb, 0x11); // flags (= Visualstream)
 
-    avio_w8(pb,  track->enc->rc_buffer_size>>(3+16));      // Buffersize DB (24 bits)
-    avio_wb16(pb, (track->enc->rc_buffer_size>>3)&0xFFFF); // Buffersize DB
+    avio_wb24(pb, track->enc->rc_buffer_size >> 3); // Buffersize DB
 
     avio_wb32(pb, FFMAX(track->enc->bit_rate, track->enc->rc_max_rate)); // maxbitrate (FIXME should be max rate in any 1 sec window)
     if(track->enc->rc_max_rate != track->enc->rc_min_rate || track->enc->rc_min_rate==0)