diff options
author | Bartlomiej Wolowiec <bartek.wolowiec@gmail.com> | 2008-04-05 20:09:36 +0000 |
---|---|---|
committer | Bartlomiej Wolowiec <bartek.wolowiec@gmail.com> | 2008-04-05 20:09:36 +0000 |
commit | 0a5754c3b729cf8fc9b938ac0724ee7261aa1606 (patch) | |
tree | 2e7b0cef43ea8ffcd01ae2b1c807336183ba358d /libavcodec/ac3_parser.c | |
parent | 0265fe81e4e1c8f8aabb58e1d60a3c0830ea2b5d (diff) | |
download | ffmpeg-0a5754c3b729cf8fc9b938ac0724ee7261aa1606.tar.gz |
change of aac_ac3_parser, so it is able to send complete portion of data to decoder
Originally committed as revision 12758 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ac3_parser.c')
-rw-r--r-- | libavcodec/ac3_parser.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/libavcodec/ac3_parser.c b/libavcodec/ac3_parser.c index d0a22b9950..57cd87f10d 100644 --- a/libavcodec/ac3_parser.c +++ b/libavcodec/ac3_parser.c @@ -123,12 +123,14 @@ int ff_ac3_parse_header(const uint8_t buf[7], AC3HeaderInfo *hdr) return 0; } -static int ac3_sync(AACAC3ParseContext *hdr_info, AACAC3FrameFlag *flag) +static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info, + int *need_next_header, int *new_frame_start) { int err; + uint64_t tmp = be2me_64(state); AC3HeaderInfo hdr; - err = ff_ac3_parse_header(hdr_info->inbuf, &hdr); + err = ff_ac3_parse_header((uint8_t *)&tmp, &hdr); if(err < 0) return 0; @@ -138,24 +140,14 @@ static int ac3_sync(AACAC3ParseContext *hdr_info, AACAC3FrameFlag *flag) hdr_info->channels = hdr.channels; hdr_info->samples = AC3_FRAME_SIZE; - switch(hdr.frame_type){ - case EAC3_FRAME_TYPE_INDEPENDENT: - *flag = FRAME_START; - break; - case EAC3_FRAME_TYPE_DEPENDENT: - *flag = FRAME_CONTINUATION; - break; - case EAC3_FRAME_TYPE_AC3_CONVERT: - *flag = FRAME_COMPLETE; - break; - } + *need_next_header = (hdr.frame_type != EAC3_FRAME_TYPE_AC3_CONVERT); + *new_frame_start = (hdr.frame_type != EAC3_FRAME_TYPE_DEPENDENT); return hdr.frame_size; } static av_cold int ac3_parse_init(AVCodecParserContext *s1) { AACAC3ParseContext *s = s1->priv_data; - s->inbuf_ptr = s->inbuf; s->header_size = AC3_HEADER_SIZE; s->sync = ac3_sync; return 0; |