Mercurial > libavformat.hg
comparison flic.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 | 8a7b2fac0a98 |
comparison
equal
deleted
inserted
replaced
2273:7eb456c4ed8a | 2274:b21c2af60bc9 |
---|---|
76 | 76 |
77 flic->pts = 0; | 77 flic->pts = 0; |
78 | 78 |
79 /* load the whole header and pull out the width and height */ | 79 /* load the whole header and pull out the width and height */ |
80 if (get_buffer(pb, header, FLIC_HEADER_SIZE) != FLIC_HEADER_SIZE) | 80 if (get_buffer(pb, header, FLIC_HEADER_SIZE) != FLIC_HEADER_SIZE) |
81 return AVERROR_IO; | 81 return AVERROR(EIO); |
82 | 82 |
83 magic_number = AV_RL16(&header[4]); | 83 magic_number = AV_RL16(&header[4]); |
84 speed = AV_RL32(&header[0x10]); | 84 speed = AV_RL32(&header[0x10]); |
85 | 85 |
86 /* initialize the decoder streams */ | 86 /* initialize the decoder streams */ |
167 | 167 |
168 while (!packet_read) { | 168 while (!packet_read) { |
169 | 169 |
170 if ((ret = get_buffer(pb, preamble, FLIC_PREAMBLE_SIZE)) != | 170 if ((ret = get_buffer(pb, preamble, FLIC_PREAMBLE_SIZE)) != |
171 FLIC_PREAMBLE_SIZE) { | 171 FLIC_PREAMBLE_SIZE) { |
172 ret = AVERROR_IO; | 172 ret = AVERROR(EIO); |
173 break; | 173 break; |
174 } | 174 } |
175 | 175 |
176 size = AV_RL32(&preamble[0]); | 176 size = AV_RL32(&preamble[0]); |
177 magic = AV_RL16(&preamble[4]); | 177 magic = AV_RL16(&preamble[4]); |
178 | 178 |
179 if (((magic == FLIC_CHUNK_MAGIC_1) || (magic == FLIC_CHUNK_MAGIC_2)) && size > FLIC_PREAMBLE_SIZE) { | 179 if (((magic == FLIC_CHUNK_MAGIC_1) || (magic == FLIC_CHUNK_MAGIC_2)) && size > FLIC_PREAMBLE_SIZE) { |
180 if (av_new_packet(pkt, size)) { | 180 if (av_new_packet(pkt, size)) { |
181 ret = AVERROR_IO; | 181 ret = AVERROR(EIO); |
182 break; | 182 break; |
183 } | 183 } |
184 pkt->stream_index = flic->video_stream_index; | 184 pkt->stream_index = flic->video_stream_index; |
185 pkt->pts = flic->pts; | 185 pkt->pts = flic->pts; |
186 pkt->pos = url_ftell(pb); | 186 pkt->pos = url_ftell(pb); |
187 memcpy(pkt->data, preamble, FLIC_PREAMBLE_SIZE); | 187 memcpy(pkt->data, preamble, FLIC_PREAMBLE_SIZE); |
188 ret = get_buffer(pb, pkt->data + FLIC_PREAMBLE_SIZE, | 188 ret = get_buffer(pb, pkt->data + FLIC_PREAMBLE_SIZE, |
189 size - FLIC_PREAMBLE_SIZE); | 189 size - FLIC_PREAMBLE_SIZE); |
190 if (ret != size - FLIC_PREAMBLE_SIZE) { | 190 if (ret != size - FLIC_PREAMBLE_SIZE) { |
191 av_free_packet(pkt); | 191 av_free_packet(pkt); |
192 ret = AVERROR_IO; | 192 ret = AVERROR(EIO); |
193 } | 193 } |
194 flic->pts += flic->frame_pts_inc; | 194 flic->pts += flic->frame_pts_inc; |
195 packet_read = 1; | 195 packet_read = 1; |
196 } else { | 196 } else { |
197 /* not interested in this chunk */ | 197 /* not interested in this chunk */ |