[MPlayer-dev-eng] About ADTS header, add adts header to raw aac data
Nico Sabbi
Nicola.Sabbi at poste.it
Tue Sep 25 10:49:58 CEST 2007
Il Tuesday 25 September 2007 10:02:57 qwen dux ha scritto:
> I received the raw acc data from network, but mplayer can't decode
> normally, faad2 also can not work.So I attempt to add the adts
> header in front of each raw aac data.There is the detail:
> buffer[0] = 0xff;
> buffer[1] = 0xf8;
> buffer[2] = 0x00 | (0x03 << 2);
> buffer[3] = 0x80 | ((au_arg.unit_len >> 11)&0x3);
> buffer[4] = (au_arg.unit_len >> 3)&0xff;
> //buffer[5] = 0xff & (((uint8_t)(au_arg.unit_len & 0x7)) << 5);
> buffer[5] = 0x1f | (((uint8_t)(au_arg.unit_len & 0x7)) << 5);
> buffer[6] = 0xfc;
what makes you believe that that mess will ever work? it won't.
You just have to do something like this:
if(es->extradata && es->extradata_len)
{
sh->wf = (WAVEFORMATEX *) malloc(sizeof(WAVEFORMATEX) +
es->extradata_len);
sh->wf->cbSize = es->extradata_len;
memcpy(sh->wf + 1, es->extradata,es->extradata_len);
}
More information about the MPlayer-dev-eng
mailing list