comparison libfaad2/decoder.c @ 31477:86888a4c406e

Improve LATM recognition. Patch by Dan Oscarsson, Dan d Oscarsson a tieto d com
author cehoyos
date Wed, 23 Jun 2010 18:44:06 +0000
parents e83eef58b30a
children
comparison
equal deleted inserted replaced
31476:d7ef415c30fa 31477:86888a4c406e
220 } 220 }
221 221
222 222
223 int32_t NEAACDECAPI NeAACDecInit(NeAACDecHandle hDecoder, uint8_t *buffer, 223 int32_t NEAACDECAPI NeAACDecInit(NeAACDecHandle hDecoder, uint8_t *buffer,
224 uint32_t buffer_size, 224 uint32_t buffer_size,
225 uint32_t *samplerate, uint8_t *channels) 225 uint32_t *samplerate, uint8_t *channels, int latm_stream)
226 { 226 {
227 uint32_t bits = 0; 227 uint32_t bits = 0;
228 bitfile ld; 228 bitfile ld;
229 adif_header adif; 229 adif_header adif;
230 adts_header adts; 230 adts_header adts;
254 hDecoder->latm_header_present = 1; 254 hDecoder->latm_header_present = 1;
255 x = NeAACDecInit2(hDecoder, &l->ASC, (l->ASCbits+7)/8, samplerate, channels); 255 x = NeAACDecInit2(hDecoder, &l->ASC, (l->ASCbits+7)/8, samplerate, channels);
256 if(x!=0) 256 if(x!=0)
257 hDecoder->latm_header_present = 0; 257 hDecoder->latm_header_present = 0;
258 return x; 258 return x;
259 }
260 else if (latm_stream) {
261 return -1;
259 } 262 }
260 else 263 else
261 /* Check if an ADIF header is present */ 264 /* Check if an ADIF header is present */
262 if ((buffer[0] == 'A') && (buffer[1] == 'D') && 265 if ((buffer[0] == 'A') && (buffer[1] == 'D') &&
263 (buffer[2] == 'I') && (buffer[3] == 'F')) 266 (buffer[2] == 'I') && (buffer[3] == 'F'))