1 Index: ffmpeg-r22950/libavcodec/allcodecs.c
2 ===================================================================
3 --- ffmpeg-r22950/libavcodec/allcodecs.c (revision 22950)
4 +++ ffmpeg-r22950/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: ffmpeg-r22950/libavcodec/avcodec.h
22 ===================================================================
23 --- ffmpeg-r22950/libavcodec/avcodec.h (revision 22950)
24 +++ ffmpeg-r22950/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: ffmpeg-r22950/libavcodec/Makefile
34 ===================================================================
35 --- ffmpeg-r22950/libavcodec/Makefile (revision 22950)
36 +++ ffmpeg-r22950/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: ffmpeg-r22950/libavcodec/latmaac.c
56 ===================================================================
57 --- ffmpeg-r22950/libavcodec/latmaac.c (revision 0)
58 +++ ffmpeg-r22950/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)
171 + int dependsOnCoder;
176 + framelen_flag = get_bits(b, 1);
177 + put_bits(o, 1, framelen_flag);
178 + dependsOnCoder = get_bits(b, 1);
179 + put_bits(o, 1, dependsOnCoder);
181 + if (dependsOnCoder) {
182 + delay = get_bits(b, 14);
183 + put_bits(o, 14, delay);
185 + ext_flag = get_bits(b, 1);
186 + put_bits(o, 1, ext_flag);
187 + if (!cfg->channelConfiguration) {
188 + // program config element
192 + if (cfg->audioObjectType == 6 || cfg->audioObjectType == 20) {
193 + layerNr = get_bits(b, 3);
194 + put_bits(o, 3, layerNr);
197 + if (cfg->audioObjectType == 22) {
198 + skip_bits(b, 5); // numOfSubFrame
199 + skip_bits(b, 11); // layer_length
201 + put_bits(o, 16, 0);
203 + if (cfg->audioObjectType == 17 ||
204 + cfg->audioObjectType == 19 ||
205 + cfg->audioObjectType == 20 ||
206 + cfg->audioObjectType == 23) {
208 + skip_bits(b, 3); // stuff
212 + skip_bits(b, 1); // extflag3
217 +static int readAudioSpecificConfig(struct AACConfig *cfg, GetBitContext *b)
223 + init_put_bits(&o, cfg->extra, sizeof(cfg->extra));
225 + // returns the number of bits read
230 + cfg->audioObjectType = get_bits(b, 5);
231 + put_bits(&o, 5, cfg->audioObjectType);
232 + if (cfg->audioObjectType == 31) {
233 + uint8_t n = get_bits(b, 6);
234 + put_bits(&o, 6, n);
235 + cfg->audioObjectType = 32 + n;
238 + cfg->samplingFrequencyIndex = get_bits(b, 4);
239 + cfg->samplingFrequency = ff_mpeg4audio_sample_rates[cfg->samplingFrequencyIndex];
240 + put_bits(&o, 4, cfg->samplingFrequencyIndex);
241 + if (cfg->samplingFrequencyIndex == 0x0f) {
242 + uint32_t f = get_bits_long(b, 24);
243 + put_bits(&o, 24, f);
244 + cfg->samplingFrequency = f;
246 + cfg->channelConfiguration = get_bits(b, 4);
247 + put_bits(&o, 4, cfg->channelConfiguration);
248 + cfg->channels = ff_mpeg4audio_channels[cfg->channelConfiguration];
250 + if (cfg->audioObjectType == 5) {
253 + // TODO: parsing !!!!!!!!!!!!!!!!
256 + switch (cfg->audioObjectType) {
269 + readGASpecificConfig(cfg, b, &o);
273 + if (sbr_present == -1) {
274 + if (cfg->samplingFrequency <= 24000) {
275 + cfg->samplingFrequency *= 2;
279 + // count the extradata
280 + ret = put_bits_count(&o);
281 + align_put_bits(&o);
282 + flush_put_bits(&o);
283 + cfg->extrasize = (ret + 7) >> 3;
287 +static void readStreamMuxConfig(struct AACParser *parser, GetBitContext *b)
289 + parser->audio_mux_version_A = 0;
290 + parser->audio_mux_version = get_bits(b, 1);
291 + if (parser->audio_mux_version == 1) { // audioMuxVersion
292 + parser->audio_mux_version_A = get_bits(b, 1);
295 + if (parser->audio_mux_version_A == 0) {
296 + int frame_length_type;
298 + if (parser->audio_mux_version == 1) {
299 + parser->taraFullness = latm_get_value(b);
301 + get_bits(b, 1); // allStreamSameTimeFraming = 1
302 + get_bits(b, 6); // numSubFrames = 0
303 + get_bits(b, 4); // numPrograms = 0
305 + // for each program
306 + get_bits(b, 3); // numLayer = 0
309 + if (parser->audio_mux_version == 0) {
310 + // audio specific config.
311 + readAudioSpecificConfig(&parser->config, b);
313 + int ascLen = latm_get_value(b);
314 + ascLen -= readAudioSpecificConfig(&parser->config, b);
317 + while (ascLen > 16) {
321 + skip_bits(b, ascLen);
324 + // these are not needed... perhaps
325 + frame_length_type = get_bits(b, 3);
326 + parser->frameLengthType = frame_length_type;
327 + if (frame_length_type == 0) {
329 + } else if (frame_length_type == 1) {
331 + } else if (frame_length_type == 3 ||
332 + frame_length_type == 4 ||
333 + frame_length_type == 5) {
334 + int celp_table_index;
335 + celp_table_index = get_bits(b, 6);
336 + } else if (frame_length_type == 6 ||
337 + frame_length_type == 7) {
338 + int hvxc_table_index;
339 + hvxc_table_index = get_bits(b, 1);
343 + parser->other_data_bits = 0;
344 + if (get_bits(b, 1)) {
345 + // other data present
346 + if (parser->audio_mux_version == 1) {
347 + parser->other_data_bits = latm_get_value(b);
349 + // other data not present
351 + parser->other_data_bits = 0;
353 + parser->other_data_bits <<= 8;
354 + esc = get_bits(b, 1);
355 + tmp = get_bits(b, 8);
356 + parser->other_data_bits |= tmp;
362 + if (get_bits(b, 1)) {
363 + parser->config_crc = get_bits(b, 8);
370 +static void readPayloadLengthInfo(struct AACParser *parser, GetBitContext *b)
373 + if (parser->frameLengthType == 0) {
374 + parser->muxSlotLengthBytes = 0;
376 + tmp = get_bits(b, 8);
377 + parser->muxSlotLengthBytes += tmp;
378 + } while (tmp == 255);
380 + if (parser->frameLengthType == 5 ||
381 + parser->frameLengthType == 7 ||
382 + parser->frameLengthType == 3) {
388 +static void readAudioMuxElement(struct AACParser *parser, GetBitContext *b, uint8_t *payload, int *payloadsize)
390 + uint8_t use_same_mux = get_bits(b, 1);
391 + if (!use_same_mux) {
392 + readStreamMuxConfig(parser, b);
395 + if (parser->audio_mux_version_A == 0) {
398 + readPayloadLengthInfo(parser, b);
401 + for (j=0; j<parser->muxSlotLengthBytes; j++) {
402 + *payload++ = get_bits(b, 8);
404 + *payloadsize = parser->muxSlotLengthBytes;
406 + // ignore otherdata
412 +static int readAudioSyncStream(struct AACParser *parser, GetBitContext *b, int size, uint8_t *payload, int *payloadsize)
415 + // ISO/IEC 14496-3 Table 1.28 - Syntax of AudioMuxElement()
416 + if (get_bits(b, 11) != 0x2b7) return -1; // not LATM
417 + muxlength = get_bits(b, 13);
419 + if (3+muxlength > size) return 0; // not enough data
421 + readAudioMuxElement(parser, b, payload, payloadsize);
423 + // we don't parse anything else here...
424 + return (3+muxlength);
428 +static void flush_buf(struct AACParser *parser, int offset) {
429 + int bytes_to_flush = min(parser->count, offset);
430 + int left = (parser->count - bytes_to_flush);
432 + if (bytes_to_flush > 0) {
434 + memcpy(parser->buf, parser->buf+bytes_to_flush, left);
435 + parser->count = left;
442 +static struct AACParser *latm_create_parser()
444 + struct AACParser *parser = (struct AACParser *)av_malloc(sizeof(struct AACParser));
445 + memset(parser, 0, sizeof(struct AACParser));
449 +static void latm_destroy_parser(struct AACParser *parser)
454 +static void latm_flush(struct AACParser *parser)
456 + parser->offset = 0;
460 +static void latm_write_data(struct AACParser *parser, uint8_t *data, int len)
462 + // buffer overflow check... just ignore the data before
463 + if (parser->count + len > MAX_SIZE) {
464 + flush_buf(parser, parser->offset);
465 + parser->offset = 0;
466 + if (parser->count + len > MAX_SIZE) {
467 + int to_flush = (parser->count+len) - MAX_SIZE;
468 + flush_buf(parser, to_flush);
473 + memcpy(parser->buf+parser->count, data, len);
474 + parser->count += len;
477 +static int latm_parse_packet(struct AACParser *parser, uint8_t *data, int maxsize)
480 + Return value is either number of bytes parsed or
482 + 0 = need more data.
485 + uint8_t *start = parser->buf + parser->offset;
486 + int bytes = parser->count - parser->offset;
488 + init_get_bits(&b, start, bytes);
490 + if (parser->mode == AAC_LATM) {
492 + int ret = readAudioSyncStream(parser, &b, bytes, data, &outsize);
494 + if (ret < 0) return -1;
495 + if (ret == 0) return 0;
497 + // update the offset
498 + parser->offset += ret;
502 + // check for syncwords
503 + while (bytes > 2) {
504 + if (show_bits(&b, 11) == SYNC_LATM) {
505 + // we must parse config first...
508 + // check if there is a complete packet available...
509 + int ret = readAudioSyncStream(parser, &b, bytes, data, &outsize);
510 + if (ret < 0) return -1;
511 + if (ret == 0) return 0;
512 + parser->offset += ret;
514 + parser->mode = AAC_LATM;
524 +static void aac_filter_close(AACDecoder *decoder)
526 + if (decoder->aac_decoder) {
527 + NeAACDecClose(decoder->aac_decoder);
528 + decoder->aac_decoder = NULL;
533 +static int aac_decoder_open(AACDecoder *decoder)
535 + if (decoder->aac_decoder) return 0;
537 + decoder->aac_decoder = NeAACDecOpen();
538 + if (!decoder->aac_decoder) return -1;
540 + // are we going to initialize from decoder specific info ?
541 + if (decoder->parser->config.extrasize > 0) {
543 + unsigned long samplerate;
545 + ret = NeAACDecInit2(decoder->aac_decoder, (unsigned char*)decoder->parser->config.extra, decoder->parser->config.extrasize, &samplerate, &decoder->in_channels);
546 + decoder->in_samplerate = samplerate;
548 + aac_filter_close(decoder); // gone wrong ?
553 + // we'll open the decoder later...
559 +static AACDecoder *aac_filter_create()
561 + AACDecoder *decoder = (AACDecoder *)av_malloc(sizeof(AACDecoder));
562 + decoder->parser = latm_create_parser();
563 + decoder->aac_decoder = NULL;
565 + return (void *)decoder;
568 +static void aac_filter_destroy(AACDecoder *decoder)
570 + aac_filter_close(decoder);
571 + latm_destroy_parser(decoder->parser);
575 +static int aac_filter_receive(AACDecoder *decoder, void *out, int *out_size, uint8_t *data, int size)
577 + uint8_t tempbuf[32*1024];
579 + int consumed = size;
581 + int max_size = *out_size;
585 + //-------------------------------------------------------------------------
586 + // Multiplex Parsing
587 + //-------------------------------------------------------------------------
589 + latm_write_data(decoder->parser, data, size);
592 + NeAACDecFrameInfo info;
595 + ret = latm_parse_packet(decoder->parser, tempbuf, sizeof(tempbuf));
597 + latm_flush(decoder->parser);
600 + if (ret == 0) return consumed;
605 + //-------------------------------------------------------------------------
606 + // Initialize decoder (if necessary)
607 + //-------------------------------------------------------------------------
608 + if (!decoder->open) {
609 + aac_filter_close(decoder);
610 + if (decoder->parser->mode == AAC_LATM) {
611 + ret = aac_decoder_open(decoder);
612 + if (ret < 0) return consumed;
615 + if(!decoder->open) return consumed;
618 + //-------------------------------------------------------------------------
620 + //-------------------------------------------------------------------------
621 + buf = NeAACDecDecode(decoder->aac_decoder, &info, data, size);
624 + decoder->in_samplerate = info.samplerate;
625 + decoder->in_channels = info.channels;
627 + //---------------------------------------------------------------------
628 + // Deliver decoded samples
629 + //---------------------------------------------------------------------
631 + // kram dekoduje 16-bit. my vypustame 16-bit. takze by to malo byt okej
632 + decoded = info.samples * sizeof(short);
634 + // napraskame tam sample
635 + *out_size += decoded;
636 + if(*out_size > max_size) {
637 + av_log(NULL, AV_LOG_ERROR, "overflow!\n");
639 + memcpy(out, buf, decoded);
640 + out = (unsigned char *)out + decoded;
647 + } while (1); // decode all packets
651 +static void aac_filter_getinfo(AACDecoder *decoder, int *sample_rate, int *channels)
653 + if(!decoder->open) return;
654 + *sample_rate = decoder->in_samplerate;
655 + *channels = decoder->in_channels;
658 +static int faac_decode_init(AVCodecContext *avctx)
660 + FAACContext *s = avctx->priv_data;
661 + avctx->sample_fmt = SAMPLE_FMT_S16;
662 + avctx->frame_size = 360;
663 + avctx->sample_rate = 48000;
664 + avctx->channels = 2;
665 + avctx->bit_rate = 8192 * 8 * avctx->sample_rate / avctx->frame_size;
666 + s->decoder = aac_filter_create();
670 +static int faac_decode_frame(AVCodecContext *avctx,
671 + void *data, int *data_size,
674 + FAACContext *s = avctx->priv_data;
677 + if (s->decoder == NULL) faac_decode_init(avctx);
678 + ret = aac_filter_receive(s->decoder, data, data_size, avpkt->data, avpkt->size);
679 + aac_filter_getinfo(s->decoder, &(avctx->sample_rate), &(avctx->channels));
683 +static int faac_decode_end(AVCodecContext *avctx)
685 + FAACContext *s = avctx->priv_data;
686 + if(s->decoder != NULL) {
687 + aac_filter_destroy(s->decoder);
692 +AVCodec libfaad2_decoder = {
693 + .name = "AAC_LATM",
694 + .type = CODEC_TYPE_AUDIO,
695 + .id = CODEC_ID_AAC_LATM,
696 + .priv_data_size = sizeof (FAACContext),
697 + .init = faac_decode_init,
698 + .close = faac_decode_end,
699 + .decode = faac_decode_frame,
700 + .long_name = "AAC over LATM",
702 Index: ffmpeg-r22950/libavcodec/latm_parser.c
703 ===================================================================
704 --- ffmpeg-r22950/libavcodec/latm_parser.c (revision 0)
705 +++ ffmpeg-r22950/libavcodec/latm_parser.c (revision 0)
709 + * Copyright (c) 2008 Paul Kendall <paul@kcbbs.gen.nz>
711 + * This file is part of FFmpeg.
713 + * FFmpeg is free software; you can redistribute it and/or
714 + * modify it under the terms of the GNU Lesser General Public
715 + * License as published by the Free Software Foundation; either
716 + * version 2.1 of the License, or (at your option) any later version.
718 + * FFmpeg is distributed in the hope that it will be useful,
719 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
720 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
721 + * Lesser General Public License for more details.
723 + * You should have received a copy of the GNU Lesser General Public
724 + * License along with FFmpeg; if not, write to the Free Software
725 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
729 + * @file latm_parser.c
735 +#define LATM_HEADER 0x56e000 // 0x2b7 (11 bits)
736 +#define LATM_MASK 0xFFE000 // top 11 bits
737 +#define LATM_SIZE_MASK 0x001FFF // bottom 13 bits
739 +typedef struct LATMParseContext{
745 + * finds the end of the current frame in the bitstream.
746 + * @return the position of the first byte of the next frame, or -1
748 +static int latm_find_frame_end(AVCodecParserContext *s1, const uint8_t *buf,
750 + LATMParseContext *s = s1->priv_data;
751 + ParseContext *pc = &s->pc;
755 + pic_found = pc->frame_start_found;
760 + for(i=0; i<buf_size; i++){
761 + state = (state<<8) | buf[i];
762 + if((state & LATM_MASK) == LATM_HEADER){
772 + /* EOF considered as end of frame */
775 + if((state & LATM_SIZE_MASK) - s->count <= buf_size) {
776 + pc->frame_start_found = 0;
778 + return (state & LATM_SIZE_MASK) - s->count;
782 + s->count += buf_size;
783 + pc->frame_start_found = pic_found;
785 + return END_NOT_FOUND;
788 +static int latm_parse(AVCodecParserContext *s1,
789 + AVCodecContext *avctx,
790 + const uint8_t **poutbuf, int *poutbuf_size,
791 + const uint8_t *buf, int buf_size)
793 + LATMParseContext *s = s1->priv_data;
794 + ParseContext *pc = &s->pc;
797 + if(s1->flags & PARSER_FLAG_COMPLETE_FRAMES){
800 + next = latm_find_frame_end(s1, buf, buf_size);
802 + if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) {
809 + *poutbuf_size = buf_size;
813 +static int latm_split(AVCodecContext *avctx,
814 + const uint8_t *buf, int buf_size)
817 + uint32_t state= -1;
819 + for(i=0; i<buf_size; i++){
820 + state= (state<<8) | buf[i];
821 + if((state & LATM_MASK) == LATM_HEADER)
827 +AVCodecParser aac_latm_parser = {
828 + { CODEC_ID_AAC_LATM },
829 + sizeof(LATMParseContext),
835 Index: ffmpeg-r22950/libavformat/mpegts.c
836 ===================================================================
837 --- ffmpeg-r22950/libavformat/mpegts.c (revision 22950)
838 +++ ffmpeg-r22950/libavformat/mpegts.c (working copy)
840 { 0x04, AVMEDIA_TYPE_AUDIO, CODEC_ID_MP3 },
841 { 0x0f, AVMEDIA_TYPE_AUDIO, CODEC_ID_AAC },
842 { 0x10, AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG4 },
843 - //{ 0x11, AVMEDIA_TYPE_AUDIO, CODEC_ID_AAC }, /* LATM syntax */
844 + { 0x11, AVMEDIA_TYPE_AUDIO, CODEC_ID_AAC_LATM }, /* LATM syntax */
845 { 0x1b, AVMEDIA_TYPE_VIDEO, CODEC_ID_H264 },
846 { 0xd1, AVMEDIA_TYPE_VIDEO, CODEC_ID_DIRAC },
847 { 0xea, AVMEDIA_TYPE_VIDEO, CODEC_ID_VC1 },
850 if ((!pes->st && pes->stream->nb_streams == MAX_STREAMS) ||
851 (pes->st && pes->st->discard == AVDISCARD_ALL) ||
852 - code == 0x1be) /* padding_stream */
853 + code == 0x1be || code == 0x1fa) /* padding_stream */
856 /* stream not present in PMT */
857 Index: ffmpeg-r22950/libavformat/mpegts.h
858 ===================================================================
859 --- ffmpeg-r22950/libavformat/mpegts.h (revision 22950)
860 +++ ffmpeg-r22950/libavformat/mpegts.h (working copy)
862 #define STREAM_TYPE_PRIVATE_DATA 0x06
863 #define STREAM_TYPE_AUDIO_AAC 0x0f
864 #define STREAM_TYPE_VIDEO_MPEG4 0x10
865 +#define STREAM_TYPE_AUDIO_AAC_LATM 0x11
866 #define STREAM_TYPE_VIDEO_H264 0x1b
867 #define STREAM_TYPE_VIDEO_VC1 0xea
868 #define STREAM_TYPE_VIDEO_DIRAC 0xd1
869 Index: ffmpeg-r22950/libavformat/mpeg.c
870 ===================================================================
871 --- ffmpeg-r22950/libavformat/mpeg.c (revision 22950)
872 +++ ffmpeg-r22950/libavformat/mpeg.c (working copy)
874 /* find matching stream */
875 if (!((startcode >= 0x1c0 && startcode <= 0x1df) ||
876 (startcode >= 0x1e0 && startcode <= 0x1ef) ||
877 - (startcode == 0x1bd) || (startcode == 0x1fd)))
878 + (startcode == 0x1bd) || (startcode == 0x1fa) || (startcode == 0x1fd)))
881 *ppos = url_ftell(s->pb) - 4;
883 } else if(es_type == STREAM_TYPE_AUDIO_AAC){
884 codec_id = CODEC_ID_AAC;
885 type = AVMEDIA_TYPE_AUDIO;
886 + } else if(es_type == STREAM_TYPE_AUDIO_AAC_LATM){
887 + codec_id = CODEC_ID_AAC_LATM;
888 + type = CODEC_TYPE_AUDIO;
889 } else if(es_type == STREAM_TYPE_VIDEO_MPEG4){
890 codec_id = CODEC_ID_MPEG4;
891 type = AVMEDIA_TYPE_VIDEO;
892 Index: ffmpeg-r22950/libavformat/mpeg.h
893 ===================================================================
894 --- ffmpeg-r22950/libavformat/mpeg.h (revision 22950)
895 +++ ffmpeg-r22950/libavformat/mpeg.h (working copy)
897 #define STREAM_TYPE_PRIVATE_DATA 0x06
898 #define STREAM_TYPE_AUDIO_AAC 0x0f
899 #define STREAM_TYPE_VIDEO_MPEG4 0x10
900 +#define STREAM_TYPE_AUDIO_AAC_LATM 0x11
901 #define STREAM_TYPE_VIDEO_H264 0x1b
903 #define STREAM_TYPE_AUDIO_AC3 0x81