comparison bethsoftvid.c @ 2274:b21c2af60bc9 libavformat

Replace all occurrences of AVERROR_IO with AVERROR(EIO).
author takis
date Thu, 19 Jul 2007 15:23:32 +0000
parents 7eb456c4ed8a
children d52c718e83f9
comparison
equal deleted inserted replaced
2273:7eb456c4ed8a 2274:b21c2af60bc9
177 unsigned char block_type; 177 unsigned char block_type;
178 int audio_length; 178 int audio_length;
179 int ret_value; 179 int ret_value;
180 180
181 if(vid->is_finished || url_feof(pb)) 181 if(vid->is_finished || url_feof(pb))
182 return AVERROR_IO; 182 return AVERROR(EIO);
183 183
184 block_type = get_byte(pb); 184 block_type = get_byte(pb);
185 switch(block_type){ 185 switch(block_type){
186 case PALETTE_BLOCK: 186 case PALETTE_BLOCK:
187 url_fseek(pb, -1, SEEK_CUR); // include block type 187 url_fseek(pb, -1, SEEK_CUR); // include block type
188 ret_value = av_get_packet(pb, pkt, 3 * 256 + 1); 188 ret_value = av_get_packet(pb, pkt, 3 * 256 + 1);
189 if(ret_value != 3 * 256 + 1){ 189 if(ret_value != 3 * 256 + 1){
190 av_free_packet(pkt); 190 av_free_packet(pkt);
191 return AVERROR_IO; 191 return AVERROR(EIO);
192 } 192 }
193 pkt->stream_index = 0; 193 pkt->stream_index = 0;
194 return ret_value; 194 return ret_value;
195 195
196 case FIRST_AUDIO_BLOCK: 196 case FIRST_AUDIO_BLOCK:
200 s->streams[1]->codec->bit_rate = s->streams[1]->codec->channels * s->streams[1]->codec->sample_rate * s->streams[1]->codec->bits_per_sample; 200 s->streams[1]->codec->bit_rate = s->streams[1]->codec->channels * s->streams[1]->codec->sample_rate * s->streams[1]->codec->bits_per_sample;
201 case AUDIO_BLOCK: 201 case AUDIO_BLOCK:
202 audio_length = get_le16(pb); 202 audio_length = get_le16(pb);
203 ret_value = av_get_packet(pb, pkt, audio_length); 203 ret_value = av_get_packet(pb, pkt, audio_length);
204 pkt->stream_index = 1; 204 pkt->stream_index = 1;
205 return (ret_value != audio_length ? AVERROR_IO : ret_value); 205 return (ret_value != audio_length ? AVERROR(EIO) : ret_value);
206 206
207 case VIDEO_P_FRAME: 207 case VIDEO_P_FRAME:
208 case VIDEO_YOFF_P_FRAME: 208 case VIDEO_YOFF_P_FRAME:
209 case VIDEO_I_FRAME: 209 case VIDEO_I_FRAME:
210 return read_frame(vid, pb, pkt, block_type, s, 210 return read_frame(vid, pb, pkt, block_type, s,
212 212
213 case EOF_BLOCK: 213 case EOF_BLOCK:
214 if(vid->nframes != 0) 214 if(vid->nframes != 0)
215 av_log(s, AV_LOG_VERBOSE, "reached terminating character but not all frames read.\n"); 215 av_log(s, AV_LOG_VERBOSE, "reached terminating character but not all frames read.\n");
216 vid->is_finished = 1; 216 vid->is_finished = 1;
217 return AVERROR_IO; 217 return AVERROR(EIO);
218 default: 218 default:
219 av_log(s, AV_LOG_ERROR, "unknown block (character = %c, decimal = %d, hex = %x)!!!\n", 219 av_log(s, AV_LOG_ERROR, "unknown block (character = %c, decimal = %d, hex = %x)!!!\n",
220 block_type, block_type, block_type); return -1; 220 block_type, block_type, block_type); return -1;
221 } 221 }
222 222