|
|
@@ -23,7 +23,7 @@ |
|
|
|
#include "parser.h" |
|
|
|
#include "mpegaudiodecheader.h" |
|
|
|
#include "libavutil/common.h" |
|
|
|
|
|
|
|
#include "libavformat/id3v1.h" // for ID3v1_TAG_SIZE |
|
|
|
|
|
|
|
typedef struct MpegAudioParseContext { |
|
|
|
ParseContext pc; |
|
|
@@ -49,6 +49,7 @@ static int mpegaudio_parse(AVCodecParserContext *s1, |
|
|
|
uint32_t state= pc->state; |
|
|
|
int i; |
|
|
|
int next= END_NOT_FOUND; |
|
|
|
int flush = !buf_size; |
|
|
|
|
|
|
|
for(i=0; i<buf_size; ){ |
|
|
|
if(s->frame_size){ |
|
|
@@ -113,6 +114,12 @@ static int mpegaudio_parse(AVCodecParserContext *s1, |
|
|
|
return buf_size; |
|
|
|
} |
|
|
|
|
|
|
|
if (flush && buf_size >= ID3v1_TAG_SIZE && memcmp(buf, "TAG", 3) == 0) { |
|
|
|
*poutbuf = NULL; |
|
|
|
*poutbuf_size = 0; |
|
|
|
return next; |
|
|
|
} |
|
|
|
|
|
|
|
*poutbuf = buf; |
|
|
|
*poutbuf_size = buf_size; |
|
|
|
return next; |
|
|
|