|
|
@ -44,7 +44,7 @@ typedef struct MpegAudioParseContext { |
|
|
|
|
|
|
|
|
|
|
|
/* useful helper to get mpeg audio stream infos. Return -1 if error in
|
|
|
|
/* useful helper to get mpeg audio stream infos. Return -1 if error in
|
|
|
|
header, otherwise the coded frame size in bytes */ |
|
|
|
header, otherwise the coded frame size in bytes */ |
|
|
|
int mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate) |
|
|
|
int ff_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate) |
|
|
|
{ |
|
|
|
{ |
|
|
|
MPADecodeContext s1, *s = &s1; |
|
|
|
MPADecodeContext s1, *s = &s1; |
|
|
|
s1.avctx = avctx; |
|
|
|
s1.avctx = avctx; |
|
|
@ -52,7 +52,7 @@ int mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate) |
|
|
|
if (ff_mpa_check_header(head) != 0) |
|
|
|
if (ff_mpa_check_header(head) != 0) |
|
|
|
return -1; |
|
|
|
return -1; |
|
|
|
|
|
|
|
|
|
|
|
if (decode_header(s, head) != 0) { |
|
|
|
if (ff_mpegaudio_decode_header(s, head) != 0) { |
|
|
|
return -1; |
|
|
|
return -1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -127,7 +127,7 @@ static int mpegaudio_parse(AVCodecParserContext *s1, |
|
|
|
header = (s->inbuf[0] << 24) | (s->inbuf[1] << 16) | |
|
|
|
header = (s->inbuf[0] << 24) | (s->inbuf[1] << 16) | |
|
|
|
(s->inbuf[2] << 8) | s->inbuf[3]; |
|
|
|
(s->inbuf[2] << 8) | s->inbuf[3]; |
|
|
|
|
|
|
|
|
|
|
|
ret = mpa_decode_header(avctx, header, &sr); |
|
|
|
ret = ff_mpa_decode_header(avctx, header, &sr); |
|
|
|
if (ret < 0) { |
|
|
|
if (ret < 0) { |
|
|
|
s->header_count= -2; |
|
|
|
s->header_count= -2; |
|
|
|
/* no sync found : move by one byte (inefficient, but simple!) */ |
|
|
|
/* no sync found : move by one byte (inefficient, but simple!) */ |
|
|
@ -146,7 +146,7 @@ static int mpegaudio_parse(AVCodecParserContext *s1, |
|
|
|
|
|
|
|
|
|
|
|
#if 0 |
|
|
|
#if 0 |
|
|
|
/* free format: prepare to compute frame size */ |
|
|
|
/* free format: prepare to compute frame size */ |
|
|
|
if (decode_header(s, header) == 1) { |
|
|
|
if (ff_mpegaudio_decode_header(s, header) == 1) { |
|
|
|
s->frame_size = -1; |
|
|
|
s->frame_size = -1; |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
@ -199,7 +199,7 @@ static int mpegaudio_parse(AVCodecParserContext *s1, |
|
|
|
s->free_format_frame_size -= padding; |
|
|
|
s->free_format_frame_size -= padding; |
|
|
|
dprintf(avctx, "free frame size=%d padding=%d\n", |
|
|
|
dprintf(avctx, "free frame size=%d padding=%d\n", |
|
|
|
s->free_format_frame_size, padding); |
|
|
|
s->free_format_frame_size, padding); |
|
|
|
decode_header(s, header1); |
|
|
|
ff_mpegaudio_decode_header(s, header1); |
|
|
|
goto next_data; |
|
|
|
goto next_data; |
|
|
|
} |
|
|
|
} |
|
|
|
p++; |
|
|
|
p++; |
|
|
|