|
Lines 1-6
Link Here
|
| 1 |
--- frontend/main.c.orig |
1 |
--- frontend/main.c.orig 2008-09-22 17:55:09 UTC |
| 2 |
+++ frontend/main.c |
2 |
+++ frontend/main.c |
| 3 |
@@ -137,6 +137,31 @@ |
3 |
@@ -137,6 +137,31 @@ static void advance_buffer(aac_buffer *b |
| 4 |
b->bytes_into_buffer = 0; |
4 |
b->bytes_into_buffer = 0; |
| 5 |
} |
5 |
} |
| 6 |
|
6 |
|
|
Lines 32-38
Link Here
|
| 32 |
static int adts_sample_rates[] = {96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000,7350,0,0,0}; |
32 |
static int adts_sample_rates[] = {96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000,7350,0,0,0}; |
| 33 |
|
33 |
|
| 34 |
static int adts_parse(aac_buffer *b, int *bitrate, float *length) |
34 |
static int adts_parse(aac_buffer *b, int *bitrate, float *length) |
| 35 |
@@ -424,6 +449,8 @@ |
35 |
@@ -424,6 +449,8 @@ static int decodeAACfile(char *aacfile, |
| 36 |
float length = 0; |
36 |
float length = 0; |
| 37 |
|
37 |
|
| 38 |
int first_time = 1; |
38 |
int first_time = 1; |
|
Lines 41-47
Link Here
|
| 41 |
|
41 |
|
| 42 |
aac_buffer b; |
42 |
aac_buffer b; |
| 43 |
|
43 |
|
| 44 |
@@ -439,17 +466,39 @@ |
44 |
@@ -439,17 +466,39 @@ static int decodeAACfile(char *aacfile, |
| 45 |
} |
45 |
} |
| 46 |
} |
46 |
} |
| 47 |
|
47 |
|
|
Lines 89-95
Link Here
|
| 89 |
|
89 |
|
| 90 |
if (!(b.buffer = (unsigned char*)malloc(FAAD_MIN_STREAMSIZE*MAX_CHANNELS))) |
90 |
if (!(b.buffer = (unsigned char*)malloc(FAAD_MIN_STREAMSIZE*MAX_CHANNELS))) |
| 91 |
{ |
91 |
{ |
| 92 |
@@ -494,19 +543,39 @@ |
92 |
@@ -494,19 +543,39 @@ static int decodeAACfile(char *aacfile, |
| 93 |
|
93 |
|
| 94 |
/* get AAC infos for printing */ |
94 |
/* get AAC infos for printing */ |
| 95 |
header_type = 0; |
95 |
header_type = 0; |
|
Lines 139-145
Link Here
|
| 139 |
|
139 |
|
| 140 |
header_type = 1; |
140 |
header_type = 1; |
| 141 |
} else if (memcmp(b.buffer, "ADIF", 4) == 0) { |
141 |
} else if (memcmp(b.buffer, "ADIF", 4) == 0) { |
| 142 |
@@ -538,7 +607,8 @@ |
142 |
@@ -538,7 +607,8 @@ static int decodeAACfile(char *aacfile, |
| 143 |
if (b.buffer) |
143 |
if (b.buffer) |
| 144 |
free(b.buffer); |
144 |
free(b.buffer); |
| 145 |
NeAACDecClose(hDecoder); |
145 |
NeAACDecClose(hDecoder); |
|
Lines 149-155
Link Here
|
| 149 |
return 1; |
149 |
return 1; |
| 150 |
} |
150 |
} |
| 151 |
advance_buffer(&b, bread); |
151 |
advance_buffer(&b, bread); |
| 152 |
@@ -564,7 +634,8 @@ |
152 |
@@ -564,7 +634,8 @@ static int decodeAACfile(char *aacfile, |
| 153 |
if (infoOnly) |
153 |
if (infoOnly) |
| 154 |
{ |
154 |
{ |
| 155 |
NeAACDecClose(hDecoder); |
155 |
NeAACDecClose(hDecoder); |
|
Lines 159-165
Link Here
|
| 159 |
if (b.buffer) |
159 |
if (b.buffer) |
| 160 |
free(b.buffer); |
160 |
free(b.buffer); |
| 161 |
return 0; |
161 |
return 0; |
| 162 |
@@ -621,7 +692,8 @@ |
162 |
@@ -621,7 +692,8 @@ static int decodeAACfile(char *aacfile, |
| 163 |
if (b.buffer) |
163 |
if (b.buffer) |
| 164 |
free(b.buffer); |
164 |
free(b.buffer); |
| 165 |
NeAACDecClose(hDecoder); |
165 |
NeAACDecClose(hDecoder); |
|
Lines 169-175
Link Here
|
| 169 |
return 0; |
169 |
return 0; |
| 170 |
} |
170 |
} |
| 171 |
} else { |
171 |
} else { |
| 172 |
@@ -662,7 +734,8 @@ |
172 |
@@ -662,7 +734,8 @@ static int decodeAACfile(char *aacfile, |
| 173 |
fclose(adtsFile); |
173 |
fclose(adtsFile); |
| 174 |
} |
174 |
} |
| 175 |
|
175 |
|
|
Lines 179-185
Link Here
|
| 179 |
|
179 |
|
| 180 |
if (!first_time && !adts_out) |
180 |
if (!first_time && !adts_out) |
| 181 |
close_audio_file(aufile); |
181 |
close_audio_file(aufile); |
| 182 |
@@ -750,6 +823,11 @@ |
182 |
@@ -750,6 +823,11 @@ static int decodeMP4file(char *mp4file, |
| 183 |
/* initialise the callback structure */ |
183 |
/* initialise the callback structure */ |
| 184 |
mp4ff_callback_t *mp4cb = malloc(sizeof(mp4ff_callback_t)); |
184 |
mp4ff_callback_t *mp4cb = malloc(sizeof(mp4ff_callback_t)); |
| 185 |
|
185 |
|
|
Lines 191-197
Link Here
|
| 191 |
mp4File = fopen(mp4file, "rb"); |
191 |
mp4File = fopen(mp4file, "rb"); |
| 192 |
mp4cb->read = read_callback; |
192 |
mp4cb->read = read_callback; |
| 193 |
mp4cb->seek = seek_callback; |
193 |
mp4cb->seek = seek_callback; |
| 194 |
@@ -1016,6 +1094,7 @@ |
194 |
@@ -1016,6 +1094,7 @@ int main(int argc, char *argv[]) |
| 195 |
int result; |
195 |
int result; |
| 196 |
int infoOnly = 0; |
196 |
int infoOnly = 0; |
| 197 |
int writeToStdio = 0; |
197 |
int writeToStdio = 0; |
|
Lines 199-205
Link Here
|
| 199 |
int object_type = LC; |
199 |
int object_type = LC; |
| 200 |
int def_srate = 0; |
200 |
int def_srate = 0; |
| 201 |
int downMatrix = 0; |
201 |
int downMatrix = 0; |
| 202 |
@@ -1229,15 +1308,30 @@ |
202 |
@@ -1229,15 +1308,30 @@ int main(int argc, char *argv[]) |
| 203 |
} |
203 |
} |
| 204 |
|
204 |
|
| 205 |
/* check for mp4 file */ |
205 |
/* check for mp4 file */ |
|
Lines 237-243
Link Here
|
| 237 |
if (header[4] == 'f' && header[5] == 't' && header[6] == 'y' && header[7] == 'p') |
237 |
if (header[4] == 'f' && header[5] == 't' && header[6] == 'y' && header[7] == 'p') |
| 238 |
mp4file = 1; |
238 |
mp4file = 1; |
| 239 |
|
239 |
|
| 240 |
@@ -1246,6 +1340,18 @@ |
240 |
@@ -1246,6 +1340,18 @@ int main(int argc, char *argv[]) |
| 241 |
result = decodeMP4file(aacFileName, audioFileName, adtsFileName, writeToStdio, |
241 |
result = decodeMP4file(aacFileName, audioFileName, adtsFileName, writeToStdio, |
| 242 |
outputFormat, format, downMatrix, noGapless, infoOnly, adts_out, &length); |
242 |
outputFormat, format, downMatrix, noGapless, infoOnly, adts_out, &length); |
| 243 |
} else { |
243 |
} else { |