1 Index: libavcodec/allcodecs.c
2 ===================================================================
3 --- ffmpeg.orig/libavcodec/allcodecs.c (revision 20594)
4 +++ ffmpeg/libavcodec/allcodecs.c (working copy)
6 REGISTER_ENCDEC (LIBDIRAC, libdirac);
7 REGISTER_ENCODER (LIBFAAC, libfaac);
8 REGISTER_DECODER (LIBFAAD, libfaad);
9 + REGISTER_DECODER (LIBFAAD, libfaad2);
10 REGISTER_ENCDEC (LIBGSM, libgsm);
11 REGISTER_ENCDEC (LIBGSM_MS, libgsm_ms);
12 REGISTER_ENCODER (LIBMP3LAME, libmp3lame);
16 REGISTER_PARSER (AAC, aac);
17 + REGISTER_PARSER (AAC, aac_latm);
18 REGISTER_PARSER (AC3, ac3);
19 REGISTER_PARSER (CAVSVIDEO, cavsvideo);
20 REGISTER_PARSER (DCA, dca);
21 Index: libavcodec/avcodec.h
22 ===================================================================
23 --- ffmpeg.orig/libavcodec/avcodec.h (revision 20594)
24 +++ ffmpeg/libavcodec/avcodec.h (working copy)
26 CODEC_ID_MP2= 0x15000,
27 CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
33 Index: libavcodec/Makefile
34 ===================================================================
35 --- ffmpeg.orig/libavcodec/Makefile (revision 20594)
36 +++ ffmpeg/libavcodec/Makefile (working copy)
38 OBJS-$(CONFIG_LIBDIRAC_DECODER) += libdiracdec.o
39 OBJS-$(CONFIG_LIBDIRAC_ENCODER) += libdiracenc.o libdirac_libschro.o
40 OBJS-$(CONFIG_LIBFAAC_ENCODER) += libfaac.o
41 -OBJS-$(CONFIG_LIBFAAD_DECODER) += libfaad.o
42 +OBJS-$(CONFIG_LIBFAAD_DECODER) += libfaad.o latmaac.o
43 OBJS-$(CONFIG_LIBGSM_DECODER) += libgsm.o
44 OBJS-$(CONFIG_LIBGSM_ENCODER) += libgsm.o
45 OBJS-$(CONFIG_LIBGSM_MS_DECODER) += libgsm.o
49 OBJS-$(CONFIG_AAC_PARSER) += aac_parser.o aac_ac3_parser.o \
51 + mpeg4audio.o latm_parser.o
52 OBJS-$(CONFIG_AC3_PARSER) += ac3_parser.o ac3tab.o \
54 OBJS-$(CONFIG_CAVSVIDEO_PARSER) += cavs_parser.o
55 Index: libavcodec/latmaac.c
56 ===================================================================
57 --- ffmpeg.orig/libavcodec/latmaac.c (revision 0)
58 +++ ffmpeg/libavcodec/latmaac.c (revision 0)
61 + * copyright (c) 2008 Paul Kendall <paul@kcbbs.gen.nz>
63 + * This file is part of FFmpeg.
65 + * FFmpeg is free software; you can redistribute it and/or
66 + * modify it under the terms of the GNU Lesser General Public
67 + * License as published by the Free Software Foundation; either
68 + * version 2.1 of the License, or (at your option) any later version.
70 + * FFmpeg is distributed in the hope that it will be useful,
71 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
72 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
73 + * Lesser General Public License for more details.
75 + * You should have received a copy of the GNU Lesser General Public
76 + * License along with FFmpeg; if not, write to the Free Software
77 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
82 + * LATM wrapped AAC decoder
89 +#include <sys/types.h>
92 +#include "get_bits.h"
93 +#include "put_bits.h"
94 +#include "mpeg4audio.h"
95 +#include "neaacdec.h"
97 +#define min(a,b) ((a)<(b) ? (a) : (b))
101 + Note: This decoder filter is intended to decode LATM streams transferred
102 + in MPEG transport streams which are only supposed to contain one program.
103 + To do a more complex LATM demuxing a separate LATM demuxer should be used.
106 +#define AAC_NONE 0 // mode not detected (or indicated in mediatype)
107 +#define AAC_LATM 1 // LATM packets (ISO/IEC 14496-3 1.7.3 Multiplex layer)
109 +#define SYNC_LATM 0x2b7 // 11 bits
111 +#define MAX_SIZE 8*1024
113 +typedef struct AACConfig
115 + uint8_t extra[64]; // should be way enough
118 + int audioObjectType;
119 + int samplingFrequencyIndex;
120 + int samplingFrequency;
121 + int channelConfiguration;
125 +typedef struct AACParser
128 + uint8_t frameLengthType;
129 + uint16_t muxSlotLengthBytes;
131 + uint8_t audio_mux_version;
132 + uint8_t audio_mux_version_A;
134 + uint8_t config_crc;
135 + int64_t other_data_bits;
138 + int offset; // byte offset in "buf" buffer
139 + uint8_t buf[MAX_SIZE]; // allocated buffer
140 + int count; // number of bytes written in buffer
143 +typedef struct AACDecoder
146 + faacDecHandle aac_decoder;
148 + uint32_t in_samplerate;
149 + uint8_t in_channels;
153 + AACDecoder* decoder;
156 +static inline int64_t latm_get_value(GetBitContext *b)
158 + uint8_t bytesForValue = get_bits(b, 2);
161 + for (i=0; i<=bytesForValue; i++) {
163 + value |= get_bits(b, 8);
168 +static void readGASpecificConfig(struct AACConfig *cfg, GetBitContext *b, PutBitContext *o)
170 + int framelen_flag = get_bits(b, 1);
171 + put_bits(o, 1, framelen_flag);
172 + int dependsOnCoder = get_bits(b, 1);
173 + put_bits(o, 1, dependsOnCoder);
178 + if (dependsOnCoder) {
179 + delay = get_bits(b, 14);
180 + put_bits(o, 14, delay);
182 + ext_flag = get_bits(b, 1);
183 + put_bits(o, 1, ext_flag);
184 + if (!cfg->channelConfiguration) {
185 + // program config element
189 + if (cfg->audioObjectType == 6 || cfg->audioObjectType == 20) {
190 + layerNr = get_bits(b, 3);
191 + put_bits(o, 3, layerNr);
194 + if (cfg->audioObjectType == 22) {
195 + skip_bits(b, 5); // numOfSubFrame
196 + skip_bits(b, 11); // layer_length
198 + put_bits(o, 16, 0);
200 + if (cfg->audioObjectType == 17 ||
201 + cfg->audioObjectType == 19 ||
202 + cfg->audioObjectType == 20 ||
203 + cfg->audioObjectType == 23) {
205 + skip_bits(b, 3); // stuff
209 + skip_bits(b, 1); // extflag3
214 +static int readAudioSpecificConfig(struct AACConfig *cfg, GetBitContext *b)
217 + init_put_bits(&o, cfg->extra, sizeof(cfg->extra));
219 + // returns the number of bits read
221 + int sbr_present = -1;
224 + cfg->audioObjectType = get_bits(b, 5);
225 + put_bits(&o, 5, cfg->audioObjectType);
226 + if (cfg->audioObjectType == 31) {
227 + uint8_t n = get_bits(b, 6);
228 + put_bits(&o, 6, n);
229 + cfg->audioObjectType = 32 + n;
232 + cfg->samplingFrequencyIndex = get_bits(b, 4);
233 + cfg->samplingFrequency = ff_mpeg4audio_sample_rates[cfg->samplingFrequencyIndex];
234 + put_bits(&o, 4, cfg->samplingFrequencyIndex);
235 + if (cfg->samplingFrequencyIndex == 0x0f) {
236 + uint32_t f = get_bits_long(b, 24);
237 + put_bits(&o, 24, f);
238 + cfg->samplingFrequency = f;
240 + cfg->channelConfiguration = get_bits(b, 4);
241 + put_bits(&o, 4, cfg->channelConfiguration);
242 + cfg->channels = ff_mpeg4audio_channels[cfg->channelConfiguration];
244 + if (cfg->audioObjectType == 5) {
247 + // TODO: parsing !!!!!!!!!!!!!!!!
250 + switch (cfg->audioObjectType) {
263 + readGASpecificConfig(cfg, b, &o);
267 + if (sbr_present == -1) {
268 + if (cfg->samplingFrequency <= 24000) {
269 + cfg->samplingFrequency *= 2;
273 + // count the extradata
274 + ret = put_bits_count(&o);
275 + align_put_bits(&o);
276 + flush_put_bits(&o);
277 + cfg->extrasize = (ret + 7) >> 3;
281 +static void readStreamMuxConfig(struct AACParser *parser, GetBitContext *b)
283 + parser->audio_mux_version_A = 0;
284 + parser->audio_mux_version = get_bits(b, 1);
285 + if (parser->audio_mux_version == 1) { // audioMuxVersion
286 + parser->audio_mux_version_A = get_bits(b, 1);
289 + if (parser->audio_mux_version_A == 0) {
290 + if (parser->audio_mux_version == 1) {
291 + parser->taraFullness = latm_get_value(b);
293 + get_bits(b, 1); // allStreamSameTimeFraming = 1
294 + get_bits(b, 6); // numSubFrames = 0
295 + get_bits(b, 4); // numPrograms = 0
297 + // for each program
298 + get_bits(b, 3); // numLayer = 0
301 + if (parser->audio_mux_version == 0) {
302 + // audio specific config.
303 + readAudioSpecificConfig(&parser->config, b);
305 + int ascLen = latm_get_value(b);
306 + ascLen -= readAudioSpecificConfig(&parser->config, b);
309 + while (ascLen > 16) {
313 + skip_bits(b, ascLen);
316 + // these are not needed... perhaps
317 + int frame_length_type = get_bits(b, 3);
318 + parser->frameLengthType = frame_length_type;
319 + if (frame_length_type == 0) {
321 + } else if (frame_length_type == 1) {
323 + } else if (frame_length_type == 3 ||
324 + frame_length_type == 4 ||
325 + frame_length_type == 5) {
326 + int celp_table_index = get_bits(b, 6);
327 + } else if (frame_length_type == 6 ||
328 + frame_length_type == 7) {
329 + int hvxc_table_index = get_bits(b, 1);
333 + parser->other_data_bits = 0;
334 + if (get_bits(b, 1)) {
335 + // other data present
336 + if (parser->audio_mux_version == 1) {
337 + parser->other_data_bits = latm_get_value(b);
339 + // other data not present
340 + parser->other_data_bits = 0;
343 + parser->other_data_bits <<= 8;
344 + esc = get_bits(b, 1);
345 + tmp = get_bits(b, 8);
346 + parser->other_data_bits |= tmp;
352 + if (get_bits(b, 1)) {
353 + parser->config_crc = get_bits(b, 8);
360 +static void readPayloadLengthInfo(struct AACParser *parser, GetBitContext *b)
363 + if (parser->frameLengthType == 0) {
364 + parser->muxSlotLengthBytes = 0;
366 + tmp = get_bits(b, 8);
367 + parser->muxSlotLengthBytes += tmp;
368 + } while (tmp == 255);
370 + if (parser->frameLengthType == 5 ||
371 + parser->frameLengthType == 7 ||
372 + parser->frameLengthType == 3) {
378 +static void readAudioMuxElement(struct AACParser *parser, GetBitContext *b, uint8_t *payload, int *payloadsize)
380 + uint8_t use_same_mux = get_bits(b, 1);
381 + if (!use_same_mux) {
382 + readStreamMuxConfig(parser, b);
385 + if (parser->audio_mux_version_A == 0) {
388 + readPayloadLengthInfo(parser, b);
391 + for (j=0; j<parser->muxSlotLengthBytes; j++) {
392 + *payload++ = get_bits(b, 8);
394 + *payloadsize = parser->muxSlotLengthBytes;
396 + // ignore otherdata
402 +static int readAudioSyncStream(struct AACParser *parser, GetBitContext *b, int size, uint8_t *payload, int *payloadsize)
404 + // ISO/IEC 14496-3 Table 1.28 - Syntax of AudioMuxElement()
405 + if (get_bits(b, 11) != 0x2b7) return -1; // not LATM
406 + int muxlength = get_bits(b, 13);
408 + if (3+muxlength > size) return 0; // not enough data
410 + readAudioMuxElement(parser, b, payload, payloadsize);
412 + // we don't parse anything else here...
413 + return (3+muxlength);
417 +static void flush_buf(struct AACParser *parser, int offset) {
418 + int bytes_to_flush = min(parser->count, offset);
419 + int left = (parser->count - bytes_to_flush);
421 + if (bytes_to_flush > 0) {
423 + memcpy(parser->buf, parser->buf+bytes_to_flush, left);
424 + parser->count = left;
431 +static struct AACParser *latm_create_parser()
433 + struct AACParser *parser = (struct AACParser *)av_malloc(sizeof(struct AACParser));
434 + memset(parser, 0, sizeof(struct AACParser));
438 +static void latm_destroy_parser(struct AACParser *parser)
443 +static void latm_flush(struct AACParser *parser)
445 + parser->offset = 0;
449 +static void latm_write_data(struct AACParser *parser, uint8_t *data, int len)
451 + // buffer overflow check... just ignore the data before
452 + if (parser->count + len > MAX_SIZE) {
453 + flush_buf(parser, parser->offset);
454 + parser->offset = 0;
455 + if (parser->count + len > MAX_SIZE) {
456 + int to_flush = (parser->count+len) - MAX_SIZE;
457 + flush_buf(parser, to_flush);
462 + memcpy(parser->buf+parser->count, data, len);
463 + parser->count += len;
466 +static int latm_parse_packet(struct AACParser *parser, uint8_t *data, int maxsize)
469 + Return value is either number of bytes parsed or
471 + 0 = need more data.
474 + uint8_t *start = parser->buf + parser->offset;
475 + int bytes = parser->count - parser->offset;
477 + init_get_bits(&b, start, bytes);
479 + if (parser->mode == AAC_LATM) {
481 + int ret = readAudioSyncStream(parser, &b, bytes, data, &outsize);
483 + if (ret < 0) return -1;
484 + if (ret == 0) return 0;
486 + // update the offset
487 + parser->offset += ret;
491 + // check for syncwords
492 + while (bytes > 2) {
493 + if (show_bits(&b, 11) == SYNC_LATM) {
494 + // we must parse config first...
497 + // check if there is a complete packet available...
498 + int ret = readAudioSyncStream(parser, &b, bytes, data, &outsize);
499 + if (ret < 0) return -1;
500 + if (ret == 0) return 0;
501 + parser->offset += ret;
503 + parser->mode = AAC_LATM;
513 +static void aac_filter_close(AACDecoder *decoder)
515 + if (decoder->aac_decoder) {
516 + NeAACDecClose(decoder->aac_decoder);
517 + decoder->aac_decoder = NULL;
522 +static int aac_decoder_open(AACDecoder *decoder)
524 + if (decoder->aac_decoder) return 0;
526 + decoder->aac_decoder = NeAACDecOpen();
527 + if (!decoder->aac_decoder) return -1;
529 + // are we going to initialize from decoder specific info ?
530 + if (decoder->parser->config.extrasize > 0) {
531 + char ret = NeAACDecInit2(decoder->aac_decoder, (unsigned char*)decoder->parser->config.extra, decoder->parser->config.extrasize, &decoder->in_samplerate, &decoder->in_channels);
533 + aac_filter_close(decoder); // gone wrong ?
538 + // we'll open the decoder later...
544 +AACDecoder *aac_filter_create()
546 + AACDecoder *decoder = (AACDecoder *)av_malloc(sizeof(AACDecoder));
547 + decoder->parser = latm_create_parser();
548 + decoder->aac_decoder = NULL;
550 + return (void *)decoder;
553 +void aac_filter_destroy(AACDecoder *decoder)
555 + aac_filter_close(decoder);
556 + latm_destroy_parser(decoder->parser);
560 +int aac_filter_receive(AACDecoder *decoder, void *out, int *out_size, uint8_t *data, int size)
562 + uint8_t tempbuf[32*1024];
564 + int consumed = size;
566 + int max_size = *out_size;
570 + //-------------------------------------------------------------------------
571 + // Multiplex Parsing
572 + //-------------------------------------------------------------------------
574 + latm_write_data(decoder->parser, data, size);
577 + ret = latm_parse_packet(decoder->parser, tempbuf, sizeof(tempbuf));
579 + latm_flush(decoder->parser);
582 + if (ret == 0) return consumed;
587 + //-------------------------------------------------------------------------
588 + // Initialize decoder (if necessary)
589 + //-------------------------------------------------------------------------
590 + if (!decoder->open) {
591 + aac_filter_close(decoder);
592 + if (decoder->parser->mode == AAC_LATM) {
593 + ret = aac_decoder_open(decoder);
594 + if (ret < 0) return consumed;
597 + if(!decoder->open) return consumed;
600 + //-------------------------------------------------------------------------
602 + //-------------------------------------------------------------------------
603 + NeAACDecFrameInfo info;
604 + void *buf = NeAACDecDecode(decoder->aac_decoder, &info, data, size);
607 + decoder->in_samplerate = info.samplerate;
608 + decoder->in_channels = info.channels;
610 + //---------------------------------------------------------------------
611 + // Deliver decoded samples
612 + //---------------------------------------------------------------------
614 + // kram dekoduje 16-bit. my vypustame 16-bit. takze by to malo byt okej
615 + decoded = info.samples * sizeof(short);
617 + // napraskame tam sample
618 + *out_size += decoded;
619 + if(*out_size > max_size) {
620 + av_log(NULL, AV_LOG_ERROR, "overflow!\n");
622 + memcpy(out, buf, decoded);
623 + out = (unsigned char *)out + decoded;
630 + } while (1); // decode all packets
634 +void aac_filter_getinfo(AACDecoder *decoder, int *sample_rate, int *channels)
636 + if(!decoder->open) return;
637 + *sample_rate = decoder->in_samplerate;
638 + *channels = decoder->in_channels;
641 +static int faac_decode_init(AVCodecContext *avctx)
643 + FAACContext *s = avctx->priv_data;
644 + avctx->frame_size = 360;
645 + avctx->sample_rate = 48000;
646 + avctx->channels = 2;
647 + avctx->bit_rate = 8192 * 8 * avctx->sample_rate / avctx->frame_size;
648 + s->decoder = aac_filter_create();
652 +static int faac_decode_frame(AVCodecContext *avctx,
653 + void *data, int *data_size,
656 + FAACContext *s = avctx->priv_data;
659 + if (s->decoder == NULL) faac_decode_init(avctx);
660 + ret = aac_filter_receive(s->decoder, data, data_size, avpkt->data, avpkt->size);
661 + aac_filter_getinfo(s->decoder, &(avctx->sample_rate), &(avctx->channels));
665 +static int faac_decode_end(AVCodecContext *avctx)
667 + FAACContext *s = avctx->priv_data;
668 + if(s->decoder != NULL) {
669 + aac_filter_destroy(s->decoder);
674 +AVCodec libfaad2_decoder = {
675 + .name = "AAC_LATM",
676 + .type = CODEC_TYPE_AUDIO,
677 + .id = CODEC_ID_AAC_LATM,
678 + .priv_data_size = sizeof (FAACContext),
679 + .init = faac_decode_init,
680 + .close = faac_decode_end,
681 + .decode = faac_decode_frame,
682 + .long_name = "AAC over LATM",
684 Index: libavcodec/latm_parser.c
685 ===================================================================
686 --- ffmpeg.orig/libavcodec/latm_parser.c (revision 0)
687 +++ ffmpeg/libavcodec/latm_parser.c (revision 0)
691 + * Copyright (c) 2008 Paul Kendall <paul@kcbbs.gen.nz>
693 + * This file is part of FFmpeg.
695 + * FFmpeg is free software; you can redistribute it and/or
696 + * modify it under the terms of the GNU Lesser General Public
697 + * License as published by the Free Software Foundation; either
698 + * version 2.1 of the License, or (at your option) any later version.
700 + * FFmpeg is distributed in the hope that it will be useful,
701 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
702 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
703 + * Lesser General Public License for more details.
705 + * You should have received a copy of the GNU Lesser General Public
706 + * License along with FFmpeg; if not, write to the Free Software
707 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
711 + * @file latm_parser.c
717 +#define LATM_HEADER 0x56e000 // 0x2b7 (11 bits)
718 +#define LATM_MASK 0xFFE000 // top 11 bits
719 +#define LATM_SIZE_MASK 0x001FFF // bottom 13 bits
721 +typedef struct LATMParseContext{
727 + * finds the end of the current frame in the bitstream.
728 + * @return the position of the first byte of the next frame, or -1
730 +static int latm_find_frame_end(AVCodecParserContext *s1, const uint8_t *buf,
732 + LATMParseContext *s = s1->priv_data;
733 + ParseContext *pc = &s->pc;
737 + pic_found = pc->frame_start_found;
742 + for(i=0; i<buf_size; i++){
743 + state = (state<<8) | buf[i];
744 + if((state & LATM_MASK) == LATM_HEADER){
754 + /* EOF considered as end of frame */
757 + if((state & LATM_SIZE_MASK) - s->count <= buf_size) {
758 + pc->frame_start_found = 0;
760 + return (state & LATM_SIZE_MASK) - s->count;
764 + s->count += buf_size;
765 + pc->frame_start_found = pic_found;
767 + return END_NOT_FOUND;
770 +static int latm_parse(AVCodecParserContext *s1,
771 + AVCodecContext *avctx,
772 + const uint8_t **poutbuf, int *poutbuf_size,
773 + const uint8_t *buf, int buf_size)
775 + LATMParseContext *s = s1->priv_data;
776 + ParseContext *pc = &s->pc;
779 + if(s1->flags & PARSER_FLAG_COMPLETE_FRAMES){
782 + next = latm_find_frame_end(s1, buf, buf_size);
784 + if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
791 + *poutbuf_size = buf_size;
795 +static int latm_split(AVCodecContext *avctx,
796 + const uint8_t *buf, int buf_size)
799 + uint32_t state= -1;
801 + for(i=0; i<buf_size; i++){
802 + state= (state<<8) | buf[i];
803 + if((state & LATM_MASK) == LATM_HEADER)
809 +AVCodecParser aac_latm_parser = {
810 + { CODEC_ID_AAC_LATM },
811 + sizeof(LATMParseContext),
817 Index: libavformat/mpegts.c
818 ===================================================================
819 --- ffmpeg.orig/libavformat/mpegts.c (revision 20594)
820 +++ ffmpeg/libavformat/mpegts.c (working copy)
822 { 0x04, CODEC_TYPE_AUDIO, CODEC_ID_MP3 },
823 { 0x0f, CODEC_TYPE_AUDIO, CODEC_ID_AAC },
824 { 0x10, CODEC_TYPE_VIDEO, CODEC_ID_MPEG4 },
825 - { 0x11, CODEC_TYPE_AUDIO, CODEC_ID_AAC }, /* LATM syntax */
826 + { 0x11, CODEC_TYPE_AUDIO, CODEC_ID_AAC_LATM }, /* LATM syntax */
827 { 0x1b, CODEC_TYPE_VIDEO, CODEC_ID_H264 },
828 { 0xd1, CODEC_TYPE_VIDEO, CODEC_ID_DIRAC },
829 { 0xea, CODEC_TYPE_VIDEO, CODEC_ID_VC1 },
832 if ((!pes->st && pes->stream->nb_streams == MAX_STREAMS) ||
833 (pes->st && pes->st->discard == AVDISCARD_ALL) ||
834 - code == 0x1be) /* padding_stream */
835 + code == 0x1be || code == 0x1fa) /* padding_stream */
838 /* stream not present in PMT */
839 Index: libavformat/mpegts.h
840 ===================================================================
841 --- ffmpeg.orig/libavformat/mpegts.h (revision 20594)
842 +++ ffmpeg/libavformat/mpegts.h (working copy)
844 #define STREAM_TYPE_PRIVATE_DATA 0x06
845 #define STREAM_TYPE_AUDIO_AAC 0x0f
846 #define STREAM_TYPE_VIDEO_MPEG4 0x10
847 +#define STREAM_TYPE_AUDIO_AAC_LATM 0x11
848 #define STREAM_TYPE_VIDEO_H264 0x1b
849 #define STREAM_TYPE_VIDEO_VC1 0xea
850 #define STREAM_TYPE_VIDEO_DIRAC 0xd1
851 Index: libavformat/mpeg.c
852 ===================================================================
853 --- ffmpeg.orig/libavformat/mpeg.c (revision 20594)
854 +++ ffmpeg/libavformat/mpeg.c (working copy)
856 /* find matching stream */
857 if (!((startcode >= 0x1c0 && startcode <= 0x1df) ||
858 (startcode >= 0x1e0 && startcode <= 0x1ef) ||
859 - (startcode == 0x1bd) || (startcode == 0x1fd)))
860 + (startcode == 0x1bd) || (startcode == 0x1fa) || (startcode == 0x1fd)))
863 *ppos = url_ftell(s->pb) - 4;
865 } else if(es_type == STREAM_TYPE_AUDIO_AAC){
866 codec_id = CODEC_ID_AAC;
867 type = CODEC_TYPE_AUDIO;
868 + } else if(es_type == STREAM_TYPE_AUDIO_AAC_LATM){
869 + codec_id = CODEC_ID_AAC_LATM;
870 + type = CODEC_TYPE_AUDIO;
871 } else if(es_type == STREAM_TYPE_VIDEO_MPEG4){
872 codec_id = CODEC_ID_MPEG4;
873 type = CODEC_TYPE_VIDEO;
874 Index: libavformat/mpeg.h
875 ===================================================================
876 --- ffmpeg.orig/libavformat/mpeg.h (revision 20594)
877 +++ ffmpeg/libavformat/mpeg.h (working copy)
879 #define STREAM_TYPE_PRIVATE_DATA 0x06
880 #define STREAM_TYPE_AUDIO_AAC 0x0f
881 #define STREAM_TYPE_VIDEO_MPEG4 0x10
882 +#define STREAM_TYPE_AUDIO_AAC_LATM 0x11
883 #define STREAM_TYPE_VIDEO_H264 0x1b
885 #define STREAM_TYPE_AUDIO_AC3 0x81