diff options
author | Benjamin Otte <otte@gnome.org> | 2008-12-16 13:00:05 +0100 |
---|---|---|
committer | Benjamin Otte <otte@gnome.org> | 2008-12-16 13:00:05 +0100 |
commit | 8132dc877d46c74c132ad1703ff2df35ee7b6f3e (patch) | |
tree | 57ac33cd55b7c1bc27fc1ac86df8726c0fd1477d | |
parent | 590499c32c60e27f3a84d4bb61e9c79827023ed3 (diff) |
implement AAC codec-data support
-rw-r--r-- | swfdec/swfdec_audio_flv.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/swfdec/swfdec_audio_flv.c b/swfdec/swfdec_audio_flv.c index 2a49ee6e..d3f8dbb1 100644 --- a/swfdec/swfdec_audio_flv.c +++ b/swfdec/swfdec_audio_flv.c @@ -102,7 +102,36 @@ swfdec_audio_flv_decode_one (SwfdecAudioFlv *flv) } else if (flv->decoder == NULL) { return NULL; } - swfdec_audio_decoder_push (flv->decoder, buffer); + if (format == SWFDEC_AUDIO_CODEC_AAC) { + SwfdecBuffer *data; + SwfdecBits bits; + guint type; + swfdec_bits_init (&bits, buffer); + type = swfdec_bits_get_u8 (&bits); + switch (type) { + case 0: + data = swfdec_bits_get_buffer (&bits, -1); + if (data) { + swfdec_audio_decoder_set_codec_data (flv->decoder, data); + swfdec_buffer_unref (data); + } + break; + case 1: + data = swfdec_bits_get_buffer (&bits, -1); + if (data) { + swfdec_audio_decoder_push (flv->decoder, data); + swfdec_buffer_unref (data); + } else { + SWFDEC_ERROR ("no data in AAC data buffer?"); + } + break; + default: + SWFDEC_FIXME ("handle AAC type %u", type); + break; + } + } else { + swfdec_audio_decoder_push (flv->decoder, buffer); + } if (flv->next_timestamp == 0) swfdec_audio_decoder_push (flv->decoder, NULL); buffer = swfdec_audio_decoder_pull (flv->decoder); |