100 #define BUFFER_PADDING_SIZE 1000
104 uint8_t * vidbuf_start =
NULL;
105 int vidbuf_nbytes = 0;
107 int bytes_copied = 0;
109 unsigned int vidbuf_capacity;
118 vidbuf_start[vidbuf_nbytes++] = block_type;
125 if(
avio_read(pb, &vidbuf_start[vidbuf_nbytes], 2) != 2)
136 vidbuf_start[vidbuf_nbytes++] = code;
140 vidbuf_start[vidbuf_nbytes++] =
avio_r8(pb);
142 if(
avio_read(pb, &vidbuf_start[vidbuf_nbytes], code) != code)
144 vidbuf_nbytes += code;
146 bytes_copied += code & 0x7F;
147 if(bytes_copied == npixels){
153 if(bytes_copied > npixels)
160 memcpy(pkt->
data, vidbuf_start, vidbuf_nbytes);
168 return vidbuf_nbytes;
179 unsigned char block_type;
191 if(ret_value != 3 * 256 + 1){
207 return ret_value != audio_length ?
AVERROR(EIO) : ret_value;
212 return read_frame(vid, pb, pkt, block_type, s,
221 av_log(s,
AV_LOG_ERROR,
"unknown block (character = %c, decimal = %d, hex = %x)!!!\n",
222 block_type, block_type, block_type);
return -1;
227 .
name =
"bethsoftvid",