OSDN Git Service

simplify
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 7 Apr 2007 23:26:11 +0000 (23:26 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 7 Apr 2007 23:26:11 +0000 (23:26 +0000)
Originally committed as revision 8669 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/bethsoftvid.c

index 97439e8..0b50471 100644 (file)
@@ -136,13 +136,12 @@ static int read_frame(BVID_DemuxContext *vid, ByteIOContext *pb, AVPacket *pkt,
         if(rle_num_bytes >= 0x80){ // rle sequence
             if(block_type == VIDEO_I_FRAME)
                 vidbuf_start[vidbuf_nbytes++] = get_byte(pb);
-            bytes_copied += rle_num_bytes - 0x80;
         } else if(rle_num_bytes){ // plain sequence
             if(get_buffer(pb, &vidbuf_start[vidbuf_nbytes], rle_num_bytes) != rle_num_bytes)
                 goto fail;
             vidbuf_nbytes += rle_num_bytes;
-            bytes_copied += rle_num_bytes;
         }
+        bytes_copied += rle_num_bytes & 0x7F;
         if(bytes_copied == npixels){ // sometimes no stop character is given, need to keep track of bytes copied
             // may contain a 0 byte even if read all pixels
             if(get_byte(pb))