[MPlayer-dev-eng] [PATCH] To Play TTA in MKA

Michael Niedermayer michaelni at gmx.at
Mon Nov 20 17:42:33 CET 2006


Hi

On Tue, Nov 21, 2006 at 12:37:17AM +0900, zo came wrote:
> Sorry, I try again...

[...]
> @@ -2307,6 +2311,37 @@
>        dp->flags = 0;
>        ds_add_packet (demuxer->audio, dp);
>      }
> +  else if (track->a_formattag == 0x77A1)  /* TTA */
> +    {
> +      /* Create TTA Header. not sure */
> +      struct __attribute__((__packed__)) {
> +        char format[4];
> +        uint16_t aformat;
> +        uint16_t channels;
> +        uint16_t bps;
> +        uint32_t sfreq;
> +        uint32_t slen;
> +        uint32_t crc; /*dummy*/
> +        uint32_t seektable[2]; /*dummy*/
> +      } tta_head; /* need sizeof >= 30 */
> +      sh_a->wf->nAvgBytesPerSec = sh_a->channels * sh_a->samplerate*2;
> +      sh_a->wf->nBlockAlign = sh_a->wf->nAvgBytesPerSec;
> +      sh_a->format = mmioFOURCC('T', 'T', 'A', '1');
> +      sh_a->wf->cbSize = sizeof(tta_head);
> +      sh_a->wf = realloc (sh_a->wf,
> +                          sizeof (WAVEFORMATEX) + sh_a->wf->cbSize);
> +      memcpy(&tta_head.format[0],(char *)&(sh_a->format),4);
> +#define FORMAT_INT 1
> +      tta_head.aformat = le2me_16(FORMAT_INT);
> +      tta_head.channels = le2me_16(track->a_channels);
> +      tta_head.bps = le2me_16(track->a_bps);
> +      tta_head.sfreq = le2me_32((uint32_t)(track->a_sfreq));
> +      tta_head.slen = le2me_32((uint32_t)(mkv_d->duration * track->a_sfreq));
> +      tta_head.crc = le2me_32(0);
> +      tta_head.seektable[0] = le2me_32(0);
> +      tta_head.seektable[1] = le2me_32(0);

this is not valid c code, __attribute__((__packed__)) will only work with
gcc and compatible compilers, yes i know mplayer is full of this shit but
IMHO we shouldnt add more especially as ita trivial to do this portably

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is



More information about the MPlayer-dev-eng mailing list