36 #define BVID_PALETTE_SIZE 3 * 256
38 #define DEFAULT_SAMPLE_RATE 11111
92 #define BUFFER_PADDING_SIZE 1000
97 int vidbuf_nbytes = 0;
101 unsigned int vidbuf_capacity;
112 "having no audio packet before the first "
131 vidbuf_start[vidbuf_nbytes++] = block_type;
138 if (
avio_read(pb, &vidbuf_start[vidbuf_nbytes], 2) != 2) {
151 vidbuf_start[vidbuf_nbytes++] = code;
155 vidbuf_start[vidbuf_nbytes++] =
avio_r8(pb);
157 if (
avio_read(pb, &vidbuf_start[vidbuf_nbytes], code) != code) {
161 vidbuf_nbytes += code;
163 bytes_copied += code & 0x7F;
164 if(bytes_copied == npixels){
170 if (bytes_copied > npixels) {
179 memcpy(pkt->
data, vidbuf_start, vidbuf_nbytes);
209 unsigned char block_type;
253 if ((ret_value =
av_get_packet(pb, pkt, audio_length)) != audio_length) {
267 return read_frame(vid, pb, pkt, block_type, s);
275 av_log(s,
AV_LOG_ERROR,
"unknown block (character = %c, decimal = %d, hex = %x)!!!\n",
276 block_type, block_type, block_type);
289 .
name =
"bethsoftvid",