Originally committed as revision 12888 to svn://svn.ffmpeg.org/ffmpeg/trunk
Michael Niedermayer authored on 2008/04/18 12:09:01... | ... |
@@ -29,7 +29,6 @@ int ff_aac_ac3_parse(AVCodecParserContext *s1, |
29 | 29 |
const uint8_t *buf, int buf_size) |
30 | 30 |
{ |
31 | 31 |
AACAC3ParseContext *s = s1->priv_data; |
32 |
- AACAC3FrameFlag frame_flag; |
|
33 | 32 |
const uint8_t *buf_ptr; |
34 | 33 |
int len; |
35 | 34 |
|
... | ... |
@@ -51,7 +50,7 @@ int ff_aac_ac3_parse(AVCodecParserContext *s1, |
51 | 51 |
|
52 | 52 |
if (s->frame_size == 0) { |
53 | 53 |
if ((s->inbuf_ptr - s->inbuf) == s->header_size) { |
54 |
- len = s->sync(s, &frame_flag); |
|
54 |
+ len = s->sync(s); |
|
55 | 55 |
if (len == 0) { |
56 | 56 |
/* no sync found : move by one byte (inefficient, but simple!) */ |
57 | 57 |
memmove(s->inbuf, s->inbuf + 1, s->header_size - 1); |
... | ... |
@@ -26,17 +26,11 @@ |
26 | 26 |
#include <stdint.h> |
27 | 27 |
#include "avcodec.h" |
28 | 28 |
|
29 |
-typedef enum{ |
|
30 |
- FRAME_COMPLETE, ///< Complete frame, ends previous frame |
|
31 |
- FRAME_START, ///< Frame start, ends previous frame |
|
32 |
- FRAME_CONTINUATION ///< Part of the previous frame |
|
33 |
-}AACAC3FrameFlag; |
|
34 |
- |
|
35 | 29 |
typedef struct AACAC3ParseContext { |
36 | 30 |
uint8_t *inbuf_ptr; |
37 | 31 |
int frame_size; |
38 | 32 |
int header_size; |
39 |
- int (*sync)(struct AACAC3ParseContext *hdr_info, AACAC3FrameFlag *flag); |
|
33 |
+ int (*sync)(struct AACAC3ParseContext *hdr_info); |
|
40 | 34 |
uint8_t inbuf[8192]; /* input buffer */ |
41 | 35 |
|
42 | 36 |
int channels; |
... | ... |
@@ -27,7 +27,7 @@ |
27 | 27 |
|
28 | 28 |
#define AAC_HEADER_SIZE 7 |
29 | 29 |
|
30 |
-static int aac_sync(AACAC3ParseContext *hdr_info, AACAC3FrameFlag *flag) |
|
30 |
+static int aac_sync(AACAC3ParseContext *hdr_info) |
|
31 | 31 |
{ |
32 | 32 |
GetBitContext bits; |
33 | 33 |
int size, rdb, ch, sr; |
... | ... |
@@ -65,7 +65,6 @@ static int aac_sync(AACAC3ParseContext *hdr_info, AACAC3FrameFlag *flag) |
65 | 65 |
hdr_info->sample_rate = ff_mpeg4audio_sample_rates[sr]; |
66 | 66 |
hdr_info->samples = (rdb + 1) * 1024; |
67 | 67 |
hdr_info->bit_rate = size * 8 * hdr_info->sample_rate / hdr_info->samples; |
68 |
- *flag = FRAME_COMPLETE; |
|
69 | 68 |
|
70 | 69 |
return size; |
71 | 70 |
} |
... | ... |
@@ -123,7 +123,7 @@ int ff_ac3_parse_header(const uint8_t buf[7], AC3HeaderInfo *hdr) |
123 | 123 |
return 0; |
124 | 124 |
} |
125 | 125 |
|
126 |
-static int ac3_sync(AACAC3ParseContext *hdr_info, AACAC3FrameFlag *flag) |
|
126 |
+static int ac3_sync(AACAC3ParseContext *hdr_info) |
|
127 | 127 |
{ |
128 | 128 |
int err; |
129 | 129 |
AC3HeaderInfo hdr; |
... | ... |
@@ -138,17 +138,6 @@ static int ac3_sync(AACAC3ParseContext *hdr_info, AACAC3FrameFlag *flag) |
138 | 138 |
hdr_info->channels = hdr.channels; |
139 | 139 |
hdr_info->samples = AC3_FRAME_SIZE; |
140 | 140 |
|
141 |
- switch(hdr.frame_type){ |
|
142 |
- case EAC3_FRAME_TYPE_INDEPENDENT: |
|
143 |
- *flag = FRAME_START; |
|
144 |
- break; |
|
145 |
- case EAC3_FRAME_TYPE_DEPENDENT: |
|
146 |
- *flag = FRAME_CONTINUATION; |
|
147 |
- break; |
|
148 |
- case EAC3_FRAME_TYPE_AC3_CONVERT: |
|
149 |
- *flag = FRAME_COMPLETE; |
|
150 |
- break; |
|
151 |
- } |
|
152 | 141 |
return hdr.frame_size; |
153 | 142 |
} |
154 | 143 |
|