36 #define BVID_PALETTE_SIZE 3 * 256
38 #define DEFAULT_SAMPLE_RATE 11111
95 #define BUFFER_PADDING_SIZE 1000
100 int vidbuf_nbytes = 0;
102 int bytes_copied = 0;
104 unsigned int vidbuf_capacity;
115 "having no audio packet before the first "
134 vidbuf_start[vidbuf_nbytes++] = block_type;
141 if (
avio_read(pb, &vidbuf_start[vidbuf_nbytes], 2) != 2) {
154 vidbuf_start[vidbuf_nbytes++] = code;
158 vidbuf_start[vidbuf_nbytes++] =
avio_r8(pb);
160 if (
avio_read(pb, &vidbuf_start[vidbuf_nbytes], code) != code) {
164 vidbuf_nbytes += code;
166 bytes_copied += code & 0x7F;
167 if(bytes_copied == npixels){
173 if (bytes_copied > npixels) {
182 memcpy(pkt->
data, vidbuf_start, vidbuf_nbytes);
215 unsigned char block_type;
259 if ((ret_value =
av_get_packet(pb, pkt, audio_length)) != audio_length) {
273 return read_frame(vid, pb, pkt, block_type, s);
281 av_log(s,
AV_LOG_ERROR,
"unknown block (character = %c, decimal = %d, hex = %x)!!!\n",
282 block_type, block_type, block_type);
295 .
name =
"bethsoftvid",