comparison mpegaudio_parser.c @ 9598:407470044819 libavcodec

Do not discard mp3 frames in the parser after a broken frame. Fixes issue1044. This may cause regressions with broken streams, if you find any, please report!
author michael
date Tue, 05 May 2009 13:46:50 +0000
parents 043574c5c153
children 6409c6ba8040
comparison
equal deleted inserted replaced
9597:b60289b3e29a 9598:407470044819
221 buf_size -= len; 221 buf_size -= len;
222 } 222 }
223 223
224 if(s->frame_size > 0 && buf_ptr - buf == s->inbuf_ptr - s->inbuf 224 if(s->frame_size > 0 && buf_ptr - buf == s->inbuf_ptr - s->inbuf
225 && buf_size + buf_ptr - buf >= s->frame_size){ 225 && buf_size + buf_ptr - buf >= s->frame_size){
226 if(s->header_count > 0){
227 *poutbuf = buf; 226 *poutbuf = buf;
228 *poutbuf_size = s->frame_size; 227 *poutbuf_size = s->frame_size;
229 }
230 buf_ptr = buf + s->frame_size; 228 buf_ptr = buf + s->frame_size;
231 s->inbuf_ptr = s->inbuf; 229 s->inbuf_ptr = s->inbuf;
232 s->frame_size = 0; 230 s->frame_size = 0;
233 break; 231 break;
234 } 232 }
235 233
236 // next_data: 234 // next_data:
237 if (s->frame_size > 0 && 235 if (s->frame_size > 0 &&
238 (s->inbuf_ptr - s->inbuf) >= s->frame_size) { 236 (s->inbuf_ptr - s->inbuf) >= s->frame_size) {
239 if(s->header_count > 0){
240 *poutbuf = s->inbuf; 237 *poutbuf = s->inbuf;
241 *poutbuf_size = s->inbuf_ptr - s->inbuf; 238 *poutbuf_size = s->inbuf_ptr - s->inbuf;
242 }
243 s->inbuf_ptr = s->inbuf; 239 s->inbuf_ptr = s->inbuf;
244 s->frame_size = 0; 240 s->frame_size = 0;
245 break; 241 break;
246 } 242 }
247 } 243 }