Mercurial > libavformat.hg
comparison flic.c @ 482:0fdc96c2f2fe libavformat
sweeping change from -EIO -> AVERROR_IO
author | melanson |
---|---|
date | Sat, 19 Jun 2004 03:59:34 +0000 |
parents | b69898ffc92a |
children | 253b5292946a |
comparison
equal
deleted
inserted
replaced
481:f1430abbbd8b | 482:0fdc96c2f2fe |
---|---|
74 | 74 |
75 flic->pts = 0; | 75 flic->pts = 0; |
76 | 76 |
77 /* load the whole header and pull out the width and height */ | 77 /* load the whole header and pull out the width and height */ |
78 if (get_buffer(pb, header, FLIC_HEADER_SIZE) != FLIC_HEADER_SIZE) | 78 if (get_buffer(pb, header, FLIC_HEADER_SIZE) != FLIC_HEADER_SIZE) |
79 return -EIO; | 79 return AVERROR_IO; |
80 | 80 |
81 magic_number = LE_16(&header[4]); | 81 magic_number = LE_16(&header[4]); |
82 speed = LE_32(&header[0x10]); | 82 speed = LE_32(&header[0x10]); |
83 | 83 |
84 /* initialize the decoder streams */ | 84 /* initialize the decoder streams */ |
162 | 162 |
163 while (!packet_read) { | 163 while (!packet_read) { |
164 | 164 |
165 if ((ret = get_buffer(pb, preamble, FLIC_PREAMBLE_SIZE)) != | 165 if ((ret = get_buffer(pb, preamble, FLIC_PREAMBLE_SIZE)) != |
166 FLIC_PREAMBLE_SIZE) { | 166 FLIC_PREAMBLE_SIZE) { |
167 ret = -EIO; | 167 ret = AVERROR_IO; |
168 break; | 168 break; |
169 } | 169 } |
170 | 170 |
171 size = LE_32(&preamble[0]); | 171 size = LE_32(&preamble[0]); |
172 magic = LE_16(&preamble[4]); | 172 magic = LE_16(&preamble[4]); |
173 | 173 |
174 if ((magic == FLIC_CHUNK_MAGIC_1) || (magic == FLIC_CHUNK_MAGIC_2)) { | 174 if ((magic == FLIC_CHUNK_MAGIC_1) || (magic == FLIC_CHUNK_MAGIC_2)) { |
175 if (av_new_packet(pkt, size)) { | 175 if (av_new_packet(pkt, size)) { |
176 ret = -EIO; | 176 ret = AVERROR_IO; |
177 break; | 177 break; |
178 } | 178 } |
179 pkt->stream_index = flic->video_stream_index; | 179 pkt->stream_index = flic->video_stream_index; |
180 pkt->pts = flic->pts; | 180 pkt->pts = flic->pts; |
181 memcpy(pkt->data, preamble, FLIC_PREAMBLE_SIZE); | 181 memcpy(pkt->data, preamble, FLIC_PREAMBLE_SIZE); |
182 ret = get_buffer(pb, pkt->data + FLIC_PREAMBLE_SIZE, | 182 ret = get_buffer(pb, pkt->data + FLIC_PREAMBLE_SIZE, |
183 size - FLIC_PREAMBLE_SIZE); | 183 size - FLIC_PREAMBLE_SIZE); |
184 if (ret != size - FLIC_PREAMBLE_SIZE) { | 184 if (ret != size - FLIC_PREAMBLE_SIZE) { |
185 av_free_packet(pkt); | 185 av_free_packet(pkt); |
186 ret = -EIO; | 186 ret = AVERROR_IO; |
187 } | 187 } |
188 flic->pts += flic->frame_pts_inc; | 188 flic->pts += flic->frame_pts_inc; |
189 packet_read = 1; | 189 packet_read = 1; |
190 } else { | 190 } else { |
191 /* not interested in this chunk */ | 191 /* not interested in this chunk */ |