comparison amr.c @ 482:0fdc96c2f2fe libavformat

sweeping change from -EIO -> AVERROR_IO
author melanson
date Sat, 19 Jun 2004 03:59:34 +0000
parents 60f897e8dd2d
children 909942162fa3
comparison
equal deleted inserted replaced
481:f1430abbbd8b 482:0fdc96c2f2fe
138 int read; 138 int read;
139 int size; 139 int size;
140 140
141 if (url_feof(&s->pb)) 141 if (url_feof(&s->pb))
142 { 142 {
143 return -EIO; 143 return AVERROR_IO;
144 } 144 }
145 145
146 toc=get_byte(&s->pb); 146 toc=get_byte(&s->pb);
147 q = (toc >> 2) & 0x01; 147 q = (toc >> 2) & 0x01;
148 ft = (toc >> 3) & 0x0F; 148 ft = (toc >> 3) & 0x0F;
149 149
150 size=packed_size[ft]; 150 size=packed_size[ft];
151 151
152 if (av_new_packet(pkt, size+1)) 152 if (av_new_packet(pkt, size+1))
153 { 153 {
154 return -EIO; 154 return AVERROR_IO;
155 } 155 }
156 pkt->stream_index = 0; 156 pkt->stream_index = 0;
157 157
158 pkt->data[0]=toc; 158 pkt->data[0]=toc;
159 159
160 read = get_buffer(&s->pb, pkt->data+1, size); 160 read = get_buffer(&s->pb, pkt->data+1, size);
161 161
162 if (read != size) 162 if (read != size)
163 { 163 {
164 av_free_packet(pkt); 164 av_free_packet(pkt);
165 return -EIO; 165 return AVERROR_IO;
166 } 166 }
167 167
168 return 0; 168 return 0;
169 } 169 }
170 else if(enc->codec_id == CODEC_ID_AMR_WB) 170 else if(enc->codec_id == CODEC_ID_AMR_WB)
174 int read; 174 int read;
175 int size; 175 int size;
176 176
177 if (url_feof(&s->pb)) 177 if (url_feof(&s->pb))
178 { 178 {
179 return -EIO; 179 return AVERROR_IO;
180 } 180 }
181 181
182 toc=get_byte(&s->pb); 182 toc=get_byte(&s->pb);
183 mode = (uint8_t)((toc >> 3) & 0x0F); 183 mode = (uint8_t)((toc >> 3) & 0x0F);
184 size = packed_size[mode]; 184 size = packed_size[mode];
185 185
186 if ( (size==0) || av_new_packet(pkt, size)) 186 if ( (size==0) || av_new_packet(pkt, size))
187 { 187 {
188 return -EIO; 188 return AVERROR_IO;
189 } 189 }
190 190
191 pkt->stream_index = 0; 191 pkt->stream_index = 0;
192 pkt->data[0]=toc; 192 pkt->data[0]=toc;
193 193
194 read = get_buffer(&s->pb, pkt->data+1, size-1); 194 read = get_buffer(&s->pb, pkt->data+1, size-1);
195 195
196 if (read != (size-1)) 196 if (read != (size-1))
197 { 197 {
198 av_free_packet(pkt); 198 av_free_packet(pkt);
199 return -EIO; 199 return AVERROR_IO;
200 } 200 }
201 201
202 return 0; 202 return 0;
203 } 203 }
204 else 204 else
205 { 205 {
206 return -EIO; 206 return AVERROR_IO;
207 } 207 }
208 } 208 }
209 209
210 static int amr_read_close(AVFormatContext *s) 210 static int amr_read_close(AVFormatContext *s)
211 { 211 {