mirror of https://git.ffmpeg.org/ffmpeg.git
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! Originally committed as revision 18741 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
3cb088868c
commit
266c1d901f
|
@ -223,10 +223,8 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
|
||||||
|
|
||||||
if(s->frame_size > 0 && buf_ptr - buf == s->inbuf_ptr - s->inbuf
|
if(s->frame_size > 0 && buf_ptr - buf == s->inbuf_ptr - s->inbuf
|
||||||
&& buf_size + buf_ptr - buf >= s->frame_size){
|
&& buf_size + buf_ptr - buf >= s->frame_size){
|
||||||
if(s->header_count > 0){
|
|
||||||
*poutbuf = buf;
|
*poutbuf = buf;
|
||||||
*poutbuf_size = s->frame_size;
|
*poutbuf_size = s->frame_size;
|
||||||
}
|
|
||||||
buf_ptr = buf + s->frame_size;
|
buf_ptr = buf + s->frame_size;
|
||||||
s->inbuf_ptr = s->inbuf;
|
s->inbuf_ptr = s->inbuf;
|
||||||
s->frame_size = 0;
|
s->frame_size = 0;
|
||||||
|
@ -236,10 +234,8 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
|
||||||
// next_data:
|
// next_data:
|
||||||
if (s->frame_size > 0 &&
|
if (s->frame_size > 0 &&
|
||||||
(s->inbuf_ptr - s->inbuf) >= s->frame_size) {
|
(s->inbuf_ptr - s->inbuf) >= s->frame_size) {
|
||||||
if(s->header_count > 0){
|
|
||||||
*poutbuf = s->inbuf;
|
*poutbuf = s->inbuf;
|
||||||
*poutbuf_size = s->inbuf_ptr - s->inbuf;
|
*poutbuf_size = s->inbuf_ptr - s->inbuf;
|
||||||
}
|
|
||||||
s->inbuf_ptr = s->inbuf;
|
s->inbuf_ptr = s->inbuf;
|
||||||
s->frame_size = 0;
|
s->frame_size = 0;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue