1 Index: libavcodec/Makefile
2 ===================================================================
3 --- libavcodec/Makefile (revision 14016)
4 +++ libavcodec/Makefile (working copy)
6 OBJS-$(CONFIG_LIBDIRAC_DECODER) += libdiracdec.o
7 OBJS-$(CONFIG_LIBDIRAC_ENCODER) += libdiracenc.o libdirac_libschro.o
8 OBJS-$(CONFIG_LIBFAAC) += libfaac.o
9 -OBJS-$(CONFIG_LIBFAAD) += libfaad.o
10 +OBJS-$(CONFIG_LIBFAAD) += libfaad.o latmaac.o
11 OBJS-$(CONFIG_LIBGSM) += libgsm.o
12 OBJS-$(CONFIG_LIBMP3LAME) += libmp3lame.o
13 OBJS-$(CONFIG_LIBSCHROEDINGER_DECODER) += libschroedingerdec.o libschroedinger.o libdirac_libschro.o
15 OBJS-$(CONFIG_LIBXVID) += libxvidff.o libxvid_rc.o
18 -OBJS-$(CONFIG_AAC_PARSER) += aac_parser.o aac_ac3_parser.o mpeg4audio.o
19 +OBJS-$(CONFIG_AAC_PARSER) += aac_parser.o aac_ac3_parser.o mpeg4audio.o latm_parser.o
20 OBJS-$(CONFIG_AC3_PARSER) += ac3_parser.o ac3tab.o aac_ac3_parser.o
21 OBJS-$(CONFIG_CAVSVIDEO_PARSER) += cavs_parser.o
22 OBJS-$(CONFIG_DCA_PARSER) += dca_parser.o
23 Index: libavcodec/latmaac.c
24 ===================================================================
25 --- libavcodec/latmaac.c (revision 0)
26 +++ libavcodec/latmaac.c (revision 0)
29 + * copyright (c) 2008 Paul Kendall <paul@kcbbs.gen.nz>
31 + * This file is part of FFmpeg.
33 + * FFmpeg is free software; you can redistribute it and/or
34 + * modify it under the terms of the GNU Lesser General Public
35 + * License as published by the Free Software Foundation; either
36 + * version 2.1 of the License, or (at your option) any later version.
38 + * FFmpeg is distributed in the hope that it will be useful,
39 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
40 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41 + * Lesser General Public License for more details.
43 + * You should have received a copy of the GNU Lesser General Public
44 + * License along with FFmpeg; if not, write to the Free Software
45 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
50 + * LATM wrapped AAC decoder
57 +#include <sys/types.h>
60 +#include "bitstream.h"
61 +#include "mpeg4audio.h"
62 +#include "neaacdec.h"
64 +#define min(a,b) ((a)<(b) ? (a) : (b))
68 + Note: This decoder filter is intended to decode LATM streams transferred
69 + in MPEG transport streams which are only supposed to contain one program.
70 + To do a more complex LATM demuxing a separate LATM demuxer should be used.
73 +#define AAC_NONE 0 // mode not detected (or indicated in mediatype)
74 +#define AAC_LATM 1 // LATM packets (ISO/IEC 14496-3 1.7.3 Multiplex layer)
76 +#define SYNC_LATM 0x2b7 // 11 bits
78 +#define MAX_SIZE 8*1024
80 +typedef struct AACConfig
82 + uint8_t extra[64]; // should be way enough
85 + int audioObjectType;
86 + int samplingFrequencyIndex;
87 + int samplingFrequency;
88 + int channelConfiguration;
92 +typedef struct AACParser
95 + uint8_t frameLengthType;
96 + uint16_t muxSlotLengthBytes;
98 + uint8_t audio_mux_version;
99 + uint8_t audio_mux_version_A;
101 + uint8_t config_crc;
102 + int64_t other_data_bits;
105 + int offset; // byte offset in "buf" buffer
106 + uint8_t buf[MAX_SIZE]; // allocated buffer
107 + int count; // number of bytes written in buffer
110 +typedef struct AACDecoder
113 + faacDecHandle aac_decoder;
115 + uint32_t in_samplerate;
116 + uint8_t in_channels;
120 + AACDecoder* decoder;
123 +static inline int64_t latm_get_value(GetBitContext *b)
125 + uint8_t bytesForValue = get_bits(b, 2);
128 + for (i=0; i<=bytesForValue; i++) {
130 + value |= get_bits(b, 8);
135 +static void readGASpecificConfig(struct AACConfig *cfg, GetBitContext *b, PutBitContext *o)
137 + int framelen_flag = get_bits(b, 1);
138 + put_bits(o, 1, framelen_flag);
139 + int dependsOnCoder = get_bits(b, 1);
140 + put_bits(o, 1, dependsOnCoder);
145 + if (dependsOnCoder) {
146 + delay = get_bits(b, 14);
147 + put_bits(o, 14, delay);
149 + ext_flag = get_bits(b, 1);
150 + put_bits(o, 1, ext_flag);
151 + if (!cfg->channelConfiguration) {
152 + // program config element
156 + if (cfg->audioObjectType == 6 || cfg->audioObjectType == 20) {
157 + layerNr = get_bits(b, 3);
158 + put_bits(o, 3, layerNr);
161 + if (cfg->audioObjectType == 22) {
162 + skip_bits(b, 5); // numOfSubFrame
163 + skip_bits(b, 11); // layer_length
165 + put_bits(o, 16, 0);
167 + if (cfg->audioObjectType == 17 ||
168 + cfg->audioObjectType == 19 ||
169 + cfg->audioObjectType == 20 ||
170 + cfg->audioObjectType == 23) {
172 + skip_bits(b, 3); // stuff
176 + skip_bits(b, 1); // extflag3
181 +static int readAudioSpecificConfig(struct AACConfig *cfg, GetBitContext *b)
184 + init_put_bits(&o, cfg->extra, sizeof(cfg->extra));
186 + // returns the number of bits read
188 + int sbr_present = -1;
191 + cfg->audioObjectType = get_bits(b, 5);
192 + put_bits(&o, 5, cfg->audioObjectType);
193 + if (cfg->audioObjectType == 31) {
194 + uint8_t n = get_bits(b, 6);
195 + put_bits(&o, 6, n);
196 + cfg->audioObjectType = 32 + n;
199 + cfg->samplingFrequencyIndex = get_bits(b, 4);
200 + cfg->samplingFrequency = ff_mpeg4audio_sample_rates[cfg->samplingFrequencyIndex];
201 + put_bits(&o, 4, cfg->samplingFrequencyIndex);
202 + if (cfg->samplingFrequencyIndex == 0x0f) {
203 + uint32_t f = get_bits_long(b, 24);
204 + put_bits(&o, 24, f);
205 + cfg->samplingFrequency = f;
207 + cfg->channelConfiguration = get_bits(b, 4);
208 + put_bits(&o, 4, cfg->channelConfiguration);
209 + cfg->channels = ff_mpeg4audio_channels[cfg->channelConfiguration];
211 + if (cfg->audioObjectType == 5) {
214 + // TODO: parsing !!!!!!!!!!!!!!!!
217 + switch (cfg->audioObjectType) {
230 + readGASpecificConfig(cfg, b, &o);
234 + if (sbr_present == -1) {
235 + if (cfg->samplingFrequency <= 24000) {
236 + cfg->samplingFrequency *= 2;
240 + // count the extradata
241 + ret = put_bits_count(&o);
242 + align_put_bits(&o);
243 + flush_put_bits(&o);
244 + cfg->extrasize = (ret + 7) >> 3;
248 +static void readStreamMuxConfig(struct AACParser *parser, GetBitContext *b)
250 + parser->audio_mux_version_A = 0;
251 + parser->audio_mux_version = get_bits(b, 1);
252 + if (parser->audio_mux_version == 1) { // audioMuxVersion
253 + parser->audio_mux_version_A = get_bits(b, 1);
256 + if (parser->audio_mux_version_A == 0) {
257 + if (parser->audio_mux_version == 1) {
258 + parser->taraFullness = latm_get_value(b);
260 + get_bits(b, 1); // allStreamSameTimeFraming = 1
261 + get_bits(b, 6); // numSubFrames = 0
262 + get_bits(b, 4); // numPrograms = 0
264 + // for each program
265 + get_bits(b, 3); // numLayer = 0
268 + if (parser->audio_mux_version == 0) {
269 + // audio specific config.
270 + readAudioSpecificConfig(&parser->config, b);
272 + int ascLen = latm_get_value(b);
273 + ascLen -= readAudioSpecificConfig(&parser->config, b);
276 + while (ascLen > 16) {
280 + skip_bits(b, ascLen);
283 + // these are not needed... perhaps
284 + int frame_length_type = get_bits(b, 3);
285 + parser->frameLengthType = frame_length_type;
286 + if (frame_length_type == 0) {
288 + } else if (frame_length_type == 1) {
290 + } else if (frame_length_type == 3 ||
291 + frame_length_type == 4 ||
292 + frame_length_type == 5) {
293 + int celp_table_index = get_bits(b, 6);
294 + } else if (frame_length_type == 6 ||
295 + frame_length_type == 7) {
296 + int hvxc_table_index = get_bits(b, 1);
300 + parser->other_data_bits = 0;
301 + if (get_bits(b, 1)) {
302 + // other data present
303 + if (parser->audio_mux_version == 1) {
304 + parser->other_data_bits = latm_get_value(b);
306 + // other data not present
307 + parser->other_data_bits = 0;
310 + parser->other_data_bits <<= 8;
311 + esc = get_bits(b, 1);
312 + tmp = get_bits(b, 8);
313 + parser->other_data_bits |= tmp;
319 + if (get_bits(b, 1)) {
320 + parser->config_crc = get_bits(b, 8);
327 +static void readPayloadLengthInfo(struct AACParser *parser, GetBitContext *b)
330 + if (parser->frameLengthType == 0) {
331 + parser->muxSlotLengthBytes = 0;
333 + tmp = get_bits(b, 8);
334 + parser->muxSlotLengthBytes += tmp;
335 + } while (tmp == 255);
337 + if (parser->frameLengthType == 5 ||
338 + parser->frameLengthType == 7 ||
339 + parser->frameLengthType == 3) {
345 +static void readAudioMuxElement(struct AACParser *parser, GetBitContext *b, uint8_t *payload, int *payloadsize)
347 + uint8_t use_same_mux = get_bits(b, 1);
348 + if (!use_same_mux) {
349 + readStreamMuxConfig(parser, b);
352 + if (parser->audio_mux_version_A == 0) {
355 + readPayloadLengthInfo(parser, b);
358 + for (j=0; j<parser->muxSlotLengthBytes; j++) {
359 + *payload++ = get_bits(b, 8);
361 + *payloadsize = parser->muxSlotLengthBytes;
363 + // ignore otherdata
369 +static int readAudioSyncStream(struct AACParser *parser, GetBitContext *b, int size, uint8_t *payload, int *payloadsize)
371 + // ISO/IEC 14496-3 Table 1.28 - Syntax of AudioMuxElement()
372 + if (get_bits(b, 11) != 0x2b7) return -1; // not LATM
373 + int muxlength = get_bits(b, 13);
375 + if (3+muxlength > size) return 0; // not enough data
377 + readAudioMuxElement(parser, b, payload, payloadsize);
379 + // we don't parse anything else here...
380 + return (3+muxlength);
384 +static void flush_buf(struct AACParser *parser, int offset) {
385 + int bytes_to_flush = min(parser->count, offset);
386 + int left = (parser->count - bytes_to_flush);
388 + if (bytes_to_flush > 0) {
390 + memcpy(parser->buf, parser->buf+bytes_to_flush, left);
391 + parser->count = left;
398 +static struct AACParser *latm_create_parser()
400 + struct AACParser *parser = (struct AACParser *)av_malloc(sizeof(struct AACParser));
401 + memset(parser, 0, sizeof(struct AACParser));
405 +static void latm_destroy_parser(struct AACParser *parser)
410 +static void latm_flush(struct AACParser *parser)
412 + parser->offset = 0;
416 +static void latm_write_data(struct AACParser *parser, uint8_t *data, int len)
418 + // buffer overflow check... just ignore the data before
419 + if (parser->count + len > MAX_SIZE) {
420 + flush_buf(parser, parser->offset);
421 + parser->offset = 0;
422 + if (parser->count + len > MAX_SIZE) {
423 + int to_flush = (parser->count+len) - MAX_SIZE;
424 + flush_buf(parser, to_flush);
429 + memcpy(parser->buf+parser->count, data, len);
430 + parser->count += len;
433 +static int latm_parse_packet(struct AACParser *parser, uint8_t *data, int maxsize)
436 + Return value is either number of bytes parsed or
438 + 0 = need more data.
441 + uint8_t *start = parser->buf + parser->offset;
442 + int bytes = parser->count - parser->offset;
444 + init_get_bits(&b, start, bytes);
446 + if (parser->mode == AAC_LATM) {
448 + int ret = readAudioSyncStream(parser, &b, bytes, data, &outsize);
450 + if (ret < 0) return -1;
451 + if (ret == 0) return 0;
453 + // update the offset
454 + parser->offset += ret;
458 + // check for syncwords
459 + while (bytes > 2) {
460 + if (show_bits(&b, 11) == SYNC_LATM) {
461 + // we must parse config first...
464 + // check if there is a complete packet available...
465 + int ret = readAudioSyncStream(parser, &b, bytes, data, &outsize);
466 + if (ret < 0) return -1;
467 + if (ret == 0) return 0;
468 + parser->offset += ret;
470 + parser->mode = AAC_LATM;
480 +static void aac_filter_close(AACDecoder *decoder)
482 + if (decoder->aac_decoder) {
483 + NeAACDecClose(decoder->aac_decoder);
484 + decoder->aac_decoder = NULL;
489 +static int aac_decoder_open(AACDecoder *decoder)
491 + if (decoder->aac_decoder) return 0;
493 + decoder->aac_decoder = NeAACDecOpen();
494 + if (!decoder->aac_decoder) return -1;
496 + // are we going to initialize from decoder specific info ?
497 + if (decoder->parser->config.extrasize > 0) {
498 + char ret = NeAACDecInit2(decoder->aac_decoder, (unsigned char*)decoder->parser->config.extra, decoder->parser->config.extrasize, &decoder->in_samplerate, &decoder->in_channels);
500 + aac_filter_close(decoder); // gone wrong ?
505 + // we'll open the decoder later...
511 +AACDecoder *aac_filter_create()
513 + AACDecoder *decoder = (AACDecoder *)av_malloc(sizeof(AACDecoder));
514 + decoder->parser = latm_create_parser();
515 + decoder->aac_decoder = NULL;
517 + return (void *)decoder;
520 +void aac_filter_destroy(AACDecoder *decoder)
522 + aac_filter_close(decoder);
523 + latm_destroy_parser(decoder->parser);
527 +int aac_filter_receive(AACDecoder *decoder, void *out, int *out_size, uint8_t *data, int size)
529 + uint8_t tempbuf[32*1024];
531 + int consumed = size;
533 + int max_size = *out_size;
537 + //-------------------------------------------------------------------------
538 + // Multiplex Parsing
539 + //-------------------------------------------------------------------------
541 + latm_write_data(decoder->parser, data, size);
544 + ret = latm_parse_packet(decoder->parser, tempbuf, sizeof(tempbuf));
546 + latm_flush(decoder->parser);
549 + if (ret == 0) return consumed;
554 + //-------------------------------------------------------------------------
555 + // Initialize decoder (if necessary)
556 + //-------------------------------------------------------------------------
557 + if (!decoder->open) {
558 + aac_filter_close(decoder);
559 + if (decoder->parser->mode == AAC_LATM) {
560 + ret = aac_decoder_open(decoder);
561 + if (ret < 0) return consumed;
564 + if(!decoder->open) return consumed;
567 + //-------------------------------------------------------------------------
569 + //-------------------------------------------------------------------------
570 + NeAACDecFrameInfo info;
571 + void *buf = NeAACDecDecode(decoder->aac_decoder, &info, data, size);
574 + decoder->in_samplerate = info.samplerate;
575 + decoder->in_channels = info.channels;
577 + //---------------------------------------------------------------------
578 + // Deliver decoded samples
579 + //---------------------------------------------------------------------
581 + // kram dekoduje 16-bit. my vypustame 16-bit. takze by to malo byt okej
582 + decoded = info.samples * sizeof(short);
584 + // napraskame tam sample
585 + *out_size += decoded;
586 + if(*out_size > max_size) {
587 + av_log(NULL, AV_LOG_ERROR, "overflow!\n");
589 + memcpy(out, buf, decoded);
590 + out = (unsigned char *)out + decoded;
597 + } while (1); // decode all packets
601 +void aac_filter_getinfo(AACDecoder *decoder, int *sample_rate, int *channels)
603 + if(!decoder->open) return;
604 + *sample_rate = decoder->in_samplerate;
605 + *channels = decoder->in_channels;
608 +static int faac_decode_init(AVCodecContext *avctx)
610 + FAACContext *s = avctx->priv_data;
611 + avctx->frame_size = 360;
612 + avctx->sample_rate = 48000;
613 + avctx->channels = 2;
614 + avctx->bit_rate = 8192 * 8 * avctx->sample_rate / avctx->frame_size;
615 + s->decoder = aac_filter_create();
619 +static int faac_decode_frame(AVCodecContext *avctx,
620 + void *data, int *data_size,
621 + uint8_t *buf, int buf_size)
623 + FAACContext *s = avctx->priv_data;
626 + if (s->decoder == NULL) faac_decode_init(avctx);
627 + ret = aac_filter_receive(s->decoder, data, data_size, buf, buf_size);
628 + aac_filter_getinfo(s->decoder, &(avctx->sample_rate), &(avctx->channels));
632 +static int faac_decode_end(AVCodecContext *avctx)
634 + FAACContext *s = avctx->priv_data;
635 + if(s->decoder != NULL) {
636 + aac_filter_destroy(s->decoder);
641 +AVCodec libfaad2_decoder = {
642 + .name = "AAC_LATM",
643 + .type = CODEC_TYPE_AUDIO,
644 + .id = CODEC_ID_AAC_LATM,
645 + .priv_data_size = sizeof (FAACContext),
646 + .init = faac_decode_init,
647 + .close = faac_decode_end,
648 + .decode = faac_decode_frame,
649 + .long_name = "AAC over LATM",
652 Index: libavcodec/latm_parser.c
653 ===================================================================
654 --- libavcodec/latm_parser.c (revision 0)
655 +++ libavcodec/latm_parser.c (revision 0)
659 + * Copyright (c) 2008 Paul Kendall <paul@kcbbs.gen.nz>
661 + * This file is part of FFmpeg.
663 + * FFmpeg is free software; you can redistribute it and/or
664 + * modify it under the terms of the GNU Lesser General Public
665 + * License as published by the Free Software Foundation; either
666 + * version 2.1 of the License, or (at your option) any later version.
668 + * FFmpeg is distributed in the hope that it will be useful,
669 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
670 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
671 + * Lesser General Public License for more details.
673 + * You should have received a copy of the GNU Lesser General Public
674 + * License along with FFmpeg; if not, write to the Free Software
675 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
679 + * @file latm_parser.c
685 +#define LATM_HEADER 0x56e000 // 0x2b7 (11 bits)
686 +#define LATM_MASK 0xFFE000 // top 11 bits
687 +#define LATM_SIZE_MASK 0x001FFF // bottom 13 bits
689 +typedef struct LATMParseContext{
695 + * finds the end of the current frame in the bitstream.
696 + * @return the position of the first byte of the next frame, or -1
698 +static int latm_find_frame_end(AVCodecParserContext *s1, const uint8_t *buf,
700 + LATMParseContext *s = s1->priv_data;
701 + ParseContext *pc = &s->pc;
705 + pic_found = pc->frame_start_found;
710 + for(i=0; i<buf_size; i++){
711 + state = (state<<8) | buf[i];
712 + if((state & LATM_MASK) == LATM_HEADER){
722 + /* EOF considered as end of frame */
725 + if((state & LATM_SIZE_MASK) - s->count <= buf_size) {
726 + pc->frame_start_found = 0;
728 + return (state & LATM_SIZE_MASK) - s->count;
732 + s->count += buf_size;
733 + pc->frame_start_found = pic_found;
735 + return END_NOT_FOUND;
738 +static int latm_parse(AVCodecParserContext *s1,
739 + AVCodecContext *avctx,
740 + const uint8_t **poutbuf, int *poutbuf_size,
741 + const uint8_t *buf, int buf_size)
743 + LATMParseContext *s = s1->priv_data;
744 + ParseContext *pc = &s->pc;
747 + if(s1->flags & PARSER_FLAG_COMPLETE_FRAMES){
750 + next = latm_find_frame_end(s1, buf, buf_size);
752 + if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
759 + *poutbuf_size = buf_size;
763 +static int latm_split(AVCodecContext *avctx,
764 + const uint8_t *buf, int buf_size)
767 + uint32_t state= -1;
769 + for(i=0; i<buf_size; i++){
770 + state= (state<<8) | buf[i];
771 + if((state & LATM_MASK) == LATM_HEADER)
777 +AVCodecParser aac_latm_parser = {
778 + { CODEC_ID_AAC_LATM },
779 + sizeof(LATMParseContext),
785 Index: libavcodec/allcodecs.c
786 ===================================================================
787 --- libavcodec/allcodecs.c (revision 14016)
788 +++ libavcodec/allcodecs.c (working copy)
790 REGISTER_ENCDEC (LIBDIRAC, libdirac);
791 REGISTER_ENCODER (LIBFAAC, libfaac);
792 REGISTER_DECODER (LIBFAAD, libfaad);
793 + REGISTER_DECODER (LIBFAAD, libfaad2);
794 REGISTER_ENCDEC (LIBGSM, libgsm);
795 REGISTER_ENCDEC (LIBGSM_MS, libgsm_ms);
796 REGISTER_ENCODER (LIBMP3LAME, libmp3lame);
800 REGISTER_PARSER (AAC, aac);
801 + REGISTER_PARSER (AAC, aac_latm);
802 REGISTER_PARSER (AC3, ac3);
803 REGISTER_PARSER (CAVSVIDEO, cavsvideo);
804 REGISTER_PARSER (DCA, dca);
805 Index: libavcodec/avcodec.h
806 ===================================================================
807 --- libavcodec/avcodec.h (revision 14016)
808 +++ libavcodec/avcodec.h (working copy)
810 #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0)
817 Index: libavformat/mpegts.c
818 ===================================================================
819 --- libavformat/mpegts.c (revision 14016)
820 +++ libavformat/mpegts.c (working copy)
822 case STREAM_TYPE_VIDEO_H264:
823 case STREAM_TYPE_VIDEO_VC1:
824 case STREAM_TYPE_AUDIO_AAC:
825 + case STREAM_TYPE_AUDIO_AAC_LATM:
826 case STREAM_TYPE_AUDIO_AC3:
827 case STREAM_TYPE_AUDIO_DTS:
828 case STREAM_TYPE_AUDIO_HDMV_DTS:
830 code = pes->header[3] | 0x100;
831 if (!((code >= 0x1c0 && code <= 0x1df) ||
832 (code >= 0x1e0 && code <= 0x1ef) ||
833 - (code == 0x1bd) || (code == 0x1fd)))
834 + (code == 0x1bd) || (code == 0x1fa) || (code == 0x1fd)))
837 /* allocate stream */
839 codec_type = CODEC_TYPE_AUDIO;
840 codec_id = CODEC_ID_AAC;
842 + case STREAM_TYPE_AUDIO_AAC_LATM:
843 + codec_type = CODEC_TYPE_AUDIO;
844 + codec_id = CODEC_ID_AAC_LATM;
846 case STREAM_TYPE_AUDIO_AC3:
847 codec_type = CODEC_TYPE_AUDIO;
848 codec_id = CODEC_ID_AC3;
849 Index: libavformat/mpegts.h
850 ===================================================================
851 --- libavformat/mpegts.h (revision 14016)
852 +++ libavformat/mpegts.h (working copy)
854 #define STREAM_TYPE_PRIVATE_DATA 0x06
855 #define STREAM_TYPE_AUDIO_AAC 0x0f
856 #define STREAM_TYPE_VIDEO_MPEG4 0x10
857 +#define STREAM_TYPE_AUDIO_AAC_LATM 0x11
858 #define STREAM_TYPE_VIDEO_H264 0x1b
859 #define STREAM_TYPE_VIDEO_VC1 0xea
861 Index: libavformat/mpeg.c
862 ===================================================================
863 --- libavformat/mpeg.c (revision 14016)
864 +++ libavformat/mpeg.c (working copy)
866 /* find matching stream */
867 if (!((startcode >= 0x1c0 && startcode <= 0x1df) ||
868 (startcode >= 0x1e0 && startcode <= 0x1ef) ||
869 - (startcode == 0x1bd) || (startcode == 0x1fd)))
870 + (startcode == 0x1bd) || (startcode == 0x1fa) || (startcode == 0x1fd)))
873 *ppos = url_ftell(s->pb) - 4;
875 } else if(es_type == STREAM_TYPE_AUDIO_AAC){
876 codec_id = CODEC_ID_AAC;
877 type = CODEC_TYPE_AUDIO;
878 + } else if(es_type == STREAM_TYPE_AUDIO_AAC_LATM){
879 + codec_id = CODEC_ID_AAC_LATM;
880 + type = CODEC_TYPE_AUDIO;
881 } else if(es_type == STREAM_TYPE_VIDEO_MPEG4){
882 codec_id = CODEC_ID_MPEG4;
883 type = CODEC_TYPE_VIDEO;
884 Index: libavformat/mpeg.h
885 ===================================================================
886 --- libavformat/mpeg.h (revision 14016)
887 +++ libavformat/mpeg.h (working copy)
889 #define STREAM_TYPE_PRIVATE_DATA 0x06
890 #define STREAM_TYPE_AUDIO_AAC 0x0f
891 #define STREAM_TYPE_VIDEO_MPEG4 0x10
892 +#define STREAM_TYPE_AUDIO_AAC_LATM 0x11
893 #define STREAM_TYPE_VIDEO_H264 0x1b
895 #define STREAM_TYPE_AUDIO_AC3 0x81