X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=contrib%2Fffmpeg%2FA00-latm.patch;h=192d703ccb948a78fa7b52519bc7e0e2bacce2a4;hb=9155051f96ff6f923fe2137e0730a300e8ce1404;hp=b17c1145f789fb65fdb8c944828884fefd88cf0b;hpb=418a63f463548ca3b951e22455ad99340a7a7079;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/contrib/ffmpeg/A00-latm.patch b/contrib/ffmpeg/A00-latm.patch index b17c1145..192d703c 100644 --- a/contrib/ffmpeg/A00-latm.patch +++ b/contrib/ffmpeg/A00-latm.patch @@ -1,28 +1,8 @@ -diff -Naur ffmpeg-r19067.orig/libavcodec/Makefile ffmpeg-r19067/libavcodec/Makefile ---- ffmpeg-r19067.orig/libavcodec/Makefile 2009-05-25 18:19:35.000000000 -0400 -+++ ffmpeg-r19067/libavcodec/Makefile 2009-06-01 12:39:48.000000000 -0400 -@@ -382,7 +382,7 @@ - OBJS-$(CONFIG_LIBDIRAC_DECODER) += libdiracdec.o - OBJS-$(CONFIG_LIBDIRAC_ENCODER) += libdiracenc.o libdirac_libschro.o - OBJS-$(CONFIG_LIBFAAC) += libfaac.o --OBJS-$(CONFIG_LIBFAAD) += libfaad.o -+OBJS-$(CONFIG_LIBFAAD) += libfaad.o latmaac.o - OBJS-$(CONFIG_LIBGSM) += libgsm.o - OBJS-$(CONFIG_LIBMP3LAME) += libmp3lame.o - OBJS-$(CONFIG_LIBOPENJPEG) += libopenjpeg.o -@@ -395,7 +395,7 @@ - OBJS-$(CONFIG_LIBXVID) += libxvidff.o libxvid_rc.o - - # parsers --OBJS-$(CONFIG_AAC_PARSER) += aac_parser.o aac_ac3_parser.o mpeg4audio.o -+OBJS-$(CONFIG_AAC_PARSER) += aac_parser.o aac_ac3_parser.o mpeg4audio.o latm_parser.o - OBJS-$(CONFIG_AC3_PARSER) += ac3_parser.o ac3tab.o aac_ac3_parser.o - OBJS-$(CONFIG_CAVSVIDEO_PARSER) += cavs_parser.o - OBJS-$(CONFIG_DCA_PARSER) += dca_parser.o -diff -Naur ffmpeg-r19067.orig/libavcodec/allcodecs.c ffmpeg-r19067/libavcodec/allcodecs.c ---- ffmpeg-r19067.orig/libavcodec/allcodecs.c 2009-05-12 15:56:48.000000000 -0400 -+++ ffmpeg-r19067/libavcodec/allcodecs.c 2009-06-01 12:39:48.000000000 -0400 -@@ -306,6 +306,7 @@ +Index: ffmpeg-r22950/libavcodec/allcodecs.c +=================================================================== +--- ffmpeg-r22950/libavcodec/allcodecs.c (revision 22950) ++++ ffmpeg-r22950/libavcodec/allcodecs.c (working copy) +@@ -334,6 +334,7 @@ REGISTER_ENCDEC (LIBDIRAC, libdirac); REGISTER_ENCODER (LIBFAAC, libfaac); REGISTER_DECODER (LIBFAAD, libfaad); @@ -30,7 +10,7 @@ diff -Naur ffmpeg-r19067.orig/libavcodec/allcodecs.c ffmpeg-r19067/libavcodec/al REGISTER_ENCDEC (LIBGSM, libgsm); REGISTER_ENCDEC (LIBGSM_MS, libgsm_ms); REGISTER_ENCODER (LIBMP3LAME, libmp3lame); -@@ -319,6 +320,7 @@ +@@ -349,6 +350,7 @@ /* parsers */ REGISTER_PARSER (AAC, aac); @@ -38,10 +18,11 @@ diff -Naur ffmpeg-r19067.orig/libavcodec/allcodecs.c ffmpeg-r19067/libavcodec/al REGISTER_PARSER (AC3, ac3); REGISTER_PARSER (CAVSVIDEO, cavsvideo); REGISTER_PARSER (DCA, dca); -diff -Naur ffmpeg-r19067.orig/libavcodec/avcodec.h ffmpeg-r19067/libavcodec/avcodec.h ---- ffmpeg-r19067.orig/libavcodec/avcodec.h 2009-05-31 02:51:18.000000000 -0400 -+++ ffmpeg-r19067/libavcodec/avcodec.h 2009-06-01 12:39:48.000000000 -0400 -@@ -271,6 +271,7 @@ +Index: ffmpeg-r22950/libavcodec/avcodec.h +=================================================================== +--- ffmpeg-r22950/libavcodec/avcodec.h (revision 22950) ++++ ffmpeg-r22950/libavcodec/avcodec.h (working copy) +@@ -286,6 +286,7 @@ CODEC_ID_MP2= 0x15000, CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 CODEC_ID_AAC, @@ -49,142 +30,33 @@ diff -Naur ffmpeg-r19067.orig/libavcodec/avcodec.h ffmpeg-r19067/libavcodec/avco CODEC_ID_AC3, CODEC_ID_DTS, CODEC_ID_VORBIS, -diff -Naur ffmpeg-r19067.orig/libavcodec/latm_parser.c ffmpeg-r19067/libavcodec/latm_parser.c ---- ffmpeg-r19067.orig/libavcodec/latm_parser.c 1969-12-31 19:00:00.000000000 -0500 -+++ ffmpeg-r19067/libavcodec/latm_parser.c 2009-06-01 12:39:48.000000000 -0400 -@@ -0,0 +1,128 @@ -+/* -+ * LATM parser -+ * Copyright (c) 2008 Paul Kendall -+ * -+ * This file is part of FFmpeg. -+ * -+ * FFmpeg is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * FFmpeg is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public -+ * License along with FFmpeg; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -+/** -+ * @file latm_parser.c -+ * LATM parser -+ */ -+ -+#include "parser.h" -+ -+#define LATM_HEADER 0x56e000 // 0x2b7 (11 bits) -+#define LATM_MASK 0xFFE000 // top 11 bits -+#define LATM_SIZE_MASK 0x001FFF // bottom 13 bits -+ -+typedef struct LATMParseContext{ -+ ParseContext pc; -+ int count; -+} LATMParseContext; -+ -+/** -+ * finds the end of the current frame in the bitstream. -+ * @return the position of the first byte of the next frame, or -1 -+ */ -+static int latm_find_frame_end(AVCodecParserContext *s1, const uint8_t *buf, -+ int buf_size) { -+ LATMParseContext *s = s1->priv_data; -+ ParseContext *pc = &s->pc; -+ int pic_found, i; -+ uint32_t state; -+ -+ pic_found = pc->frame_start_found; -+ state = pc->state; -+ -+ i = 0; -+ if(!pic_found){ -+ for(i=0; icount = - i; -+ pic_found=1; -+ break; -+ } -+ } -+ } -+ -+ if(pic_found){ -+ /* EOF considered as end of frame */ -+ if (buf_size == 0) -+ return 0; -+ if((state & LATM_SIZE_MASK) - s->count <= buf_size) { -+ pc->frame_start_found = 0; -+ pc->state = -1; -+ return (state & LATM_SIZE_MASK) - s->count; -+ } -+ } -+ -+ s->count += buf_size; -+ pc->frame_start_found = pic_found; -+ pc->state = state; -+ return END_NOT_FOUND; -+} -+ -+static int latm_parse(AVCodecParserContext *s1, -+ AVCodecContext *avctx, -+ const uint8_t **poutbuf, int *poutbuf_size, -+ const uint8_t *buf, int buf_size) -+{ -+ LATMParseContext *s = s1->priv_data; -+ ParseContext *pc = &s->pc; -+ int next; -+ -+ if(s1->flags & PARSER_FLAG_COMPLETE_FRAMES){ -+ next = buf_size; -+ }else{ -+ next = latm_find_frame_end(s1, buf, buf_size); -+ -+ if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) { -+ *poutbuf = NULL; -+ *poutbuf_size = 0; -+ return buf_size; -+ } -+ } -+ *poutbuf = buf; -+ *poutbuf_size = buf_size; -+ return next; -+} -+ -+static int latm_split(AVCodecContext *avctx, -+ const uint8_t *buf, int buf_size) -+{ -+ int i; -+ uint32_t state= -1; -+ -+ for(i=0; i + * @@ -295,14 +167,17 @@ diff -Naur ffmpeg-r19067.orig/libavcodec/latmaac.c ffmpeg-r19067/libavcodec/latm + +static void readGASpecificConfig(struct AACConfig *cfg, GetBitContext *b, PutBitContext *o) +{ -+ int framelen_flag = get_bits(b, 1); -+ put_bits(o, 1, framelen_flag); -+ int dependsOnCoder = get_bits(b, 1); -+ put_bits(o, 1, dependsOnCoder); ++ int framelen_flag; ++ int dependsOnCoder; + int ext_flag; + int delay; + int layerNr; + ++ framelen_flag = get_bits(b, 1); ++ put_bits(o, 1, framelen_flag); ++ dependsOnCoder = get_bits(b, 1); ++ put_bits(o, 1, dependsOnCoder); ++ + if (dependsOnCoder) { + delay = get_bits(b, 14); + put_bits(o, 14, delay); @@ -341,13 +216,16 @@ diff -Naur ffmpeg-r19067.orig/libavcodec/latmaac.c ffmpeg-r19067/libavcodec/latm + +static int readAudioSpecificConfig(struct AACConfig *cfg, GetBitContext *b) +{ ++ int ret; ++ int sbr_present; + PutBitContext o; ++ + init_put_bits(&o, cfg->extra, sizeof(cfg->extra)); + + // returns the number of bits read -+ int ret = 0; -+ int sbr_present = -1; + ++ ret = 0; ++ sbr_present = -1; + // object + cfg->audioObjectType = get_bits(b, 5); + put_bits(&o, 5, cfg->audioObjectType); @@ -415,6 +293,8 @@ diff -Naur ffmpeg-r19067.orig/libavcodec/latmaac.c ffmpeg-r19067/libavcodec/latm + } + + if (parser->audio_mux_version_A == 0) { ++ int frame_length_type; ++ + if (parser->audio_mux_version == 1) { + parser->taraFullness = latm_get_value(b); + } @@ -442,7 +322,7 @@ diff -Naur ffmpeg-r19067.orig/libavcodec/latmaac.c ffmpeg-r19067/libavcodec/latm + } + + // these are not needed... perhaps -+ int frame_length_type = get_bits(b, 3); ++ frame_length_type = get_bits(b, 3); + parser->frameLengthType = frame_length_type; + if (frame_length_type == 0) { + get_bits(b, 8); @@ -451,10 +331,12 @@ diff -Naur ffmpeg-r19067.orig/libavcodec/latmaac.c ffmpeg-r19067/libavcodec/latm + } else if (frame_length_type == 3 || + frame_length_type == 4 || + frame_length_type == 5) { -+ int celp_table_index = get_bits(b, 6); ++ int celp_table_index; ++ celp_table_index = get_bits(b, 6); + } else if (frame_length_type == 6 || + frame_length_type == 7) { -+ int hvxc_table_index = get_bits(b, 1); ++ int hvxc_table_index; ++ hvxc_table_index = get_bits(b, 1); + } + + // other data @@ -465,8 +347,8 @@ diff -Naur ffmpeg-r19067.orig/libavcodec/latmaac.c ffmpeg-r19067/libavcodec/latm + parser->other_data_bits = latm_get_value(b); + } else { + // other data not present -+ parser->other_data_bits = 0; + int esc, tmp; ++ parser->other_data_bits = 0; + do { + parser->other_data_bits <<= 8; + esc = get_bits(b, 1); @@ -529,9 +411,10 @@ diff -Naur ffmpeg-r19067.orig/libavcodec/latmaac.c ffmpeg-r19067/libavcodec/latm + +static int readAudioSyncStream(struct AACParser *parser, GetBitContext *b, int size, uint8_t *payload, int *payloadsize) +{ ++ int muxlength; + // ISO/IEC 14496-3 Table 1.28 - Syntax of AudioMuxElement() + if (get_bits(b, 11) != 0x2b7) return -1; // not LATM -+ int muxlength = get_bits(b, 13); ++ muxlength = get_bits(b, 13); + + if (3+muxlength > size) return 0; // not enough data + @@ -656,7 +539,11 @@ diff -Naur ffmpeg-r19067.orig/libavcodec/latmaac.c ffmpeg-r19067/libavcodec/latm + + // are we going to initialize from decoder specific info ? + if (decoder->parser->config.extrasize > 0) { -+ char ret = NeAACDecInit2(decoder->aac_decoder, (unsigned char*)decoder->parser->config.extra, decoder->parser->config.extrasize, &decoder->in_samplerate, &decoder->in_channels); ++ char ret; ++ unsigned long samplerate; ++ ++ ret = NeAACDecInit2(decoder->aac_decoder, (unsigned char*)decoder->parser->config.extra, decoder->parser->config.extrasize, &samplerate, &decoder->in_channels); ++ decoder->in_samplerate = samplerate; + if (ret < 0) { + aac_filter_close(decoder); // gone wrong ? + return -1; @@ -669,7 +556,7 @@ diff -Naur ffmpeg-r19067.orig/libavcodec/latmaac.c ffmpeg-r19067/libavcodec/latm + return 0; +} + -+AACDecoder *aac_filter_create() ++static AACDecoder *aac_filter_create() +{ + AACDecoder *decoder = (AACDecoder *)av_malloc(sizeof(AACDecoder)); + decoder->parser = latm_create_parser(); @@ -678,14 +565,14 @@ diff -Naur ffmpeg-r19067.orig/libavcodec/latmaac.c ffmpeg-r19067/libavcodec/latm + return (void *)decoder; +} + -+void aac_filter_destroy(AACDecoder *decoder) ++static void aac_filter_destroy(AACDecoder *decoder) +{ + aac_filter_close(decoder); + latm_destroy_parser(decoder->parser); + av_free(decoder); +} + -+int aac_filter_receive(AACDecoder *decoder, void *out, int *out_size, uint8_t *data, int size) ++static int aac_filter_receive(AACDecoder *decoder, void *out, int *out_size, uint8_t *data, int size) +{ + uint8_t tempbuf[32*1024]; + int ret; @@ -702,6 +589,9 @@ diff -Naur ffmpeg-r19067.orig/libavcodec/latmaac.c ffmpeg-r19067/libavcodec/latm + latm_write_data(decoder->parser, data, size); + + do { ++ NeAACDecFrameInfo info; ++ void *buf; ++ + ret = latm_parse_packet(decoder->parser, tempbuf, sizeof(tempbuf)); + if (ret < 0) { + latm_flush(decoder->parser); @@ -728,8 +618,7 @@ diff -Naur ffmpeg-r19067.orig/libavcodec/latmaac.c ffmpeg-r19067/libavcodec/latm + //------------------------------------------------------------------------- + // Decode samples + //------------------------------------------------------------------------- -+ NeAACDecFrameInfo info; -+ void *buf = NeAACDecDecode(decoder->aac_decoder, &info, data, size); ++ buf = NeAACDecDecode(decoder->aac_decoder, &info, data, size); + + if (buf) { + decoder->in_samplerate = info.samplerate; @@ -759,7 +648,7 @@ diff -Naur ffmpeg-r19067.orig/libavcodec/latmaac.c ffmpeg-r19067/libavcodec/latm + return consumed; +} + -+void aac_filter_getinfo(AACDecoder *decoder, int *sample_rate, int *channels) ++static void aac_filter_getinfo(AACDecoder *decoder, int *sample_rate, int *channels) +{ + if(!decoder->open) return; + *sample_rate = decoder->in_samplerate; @@ -769,6 +658,7 @@ diff -Naur ffmpeg-r19067.orig/libavcodec/latmaac.c ffmpeg-r19067/libavcodec/latm +static int faac_decode_init(AVCodecContext *avctx) +{ + FAACContext *s = avctx->priv_data; ++ avctx->sample_fmt = SAMPLE_FMT_S16; + avctx->frame_size = 360; + avctx->sample_rate = 48000; + avctx->channels = 2; @@ -809,10 +699,178 @@ diff -Naur ffmpeg-r19067.orig/libavcodec/latmaac.c ffmpeg-r19067/libavcodec/latm + .decode = faac_decode_frame, + .long_name = "AAC over LATM", +}; -diff -Naur ffmpeg-r19067.orig/libavformat/mpeg.c ffmpeg-r19067/libavformat/mpeg.c ---- ffmpeg-r19067.orig/libavformat/mpeg.c 2009-04-17 14:08:39.000000000 -0400 -+++ ffmpeg-r19067/libavformat/mpeg.c 2009-06-01 12:39:48.000000000 -0400 -@@ -279,7 +279,7 @@ +Index: ffmpeg-r22950/libavcodec/latm_parser.c +=================================================================== +--- ffmpeg-r22950/libavcodec/latm_parser.c (revision 0) ++++ ffmpeg-r22950/libavcodec/latm_parser.c (revision 0) +@@ -0,0 +1,128 @@ ++/* ++ * LATM parser ++ * Copyright (c) 2008 Paul Kendall ++ * ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++/** ++ * @file latm_parser.c ++ * LATM parser ++ */ ++ ++#include "parser.h" ++ ++#define LATM_HEADER 0x56e000 // 0x2b7 (11 bits) ++#define LATM_MASK 0xFFE000 // top 11 bits ++#define LATM_SIZE_MASK 0x001FFF // bottom 13 bits ++ ++typedef struct LATMParseContext{ ++ ParseContext pc; ++ int count; ++} LATMParseContext; ++ ++/** ++ * finds the end of the current frame in the bitstream. ++ * @return the position of the first byte of the next frame, or -1 ++ */ ++static int latm_find_frame_end(AVCodecParserContext *s1, const uint8_t *buf, ++ int buf_size) { ++ LATMParseContext *s = s1->priv_data; ++ ParseContext *pc = &s->pc; ++ int pic_found, i; ++ uint32_t state; ++ ++ pic_found = pc->frame_start_found; ++ state = pc->state; ++ ++ i = 0; ++ if(!pic_found){ ++ for(i=0; icount = - i; ++ pic_found=1; ++ break; ++ } ++ } ++ } ++ ++ if(pic_found){ ++ /* EOF considered as end of frame */ ++ if (buf_size == 0) ++ return 0; ++ if((state & LATM_SIZE_MASK) - s->count <= buf_size) { ++ pc->frame_start_found = 0; ++ pc->state = -1; ++ return (state & LATM_SIZE_MASK) - s->count; ++ } ++ } ++ ++ s->count += buf_size; ++ pc->frame_start_found = pic_found; ++ pc->state = state; ++ return END_NOT_FOUND; ++} ++ ++static int latm_parse(AVCodecParserContext *s1, ++ AVCodecContext *avctx, ++ const uint8_t **poutbuf, int *poutbuf_size, ++ const uint8_t *buf, int buf_size) ++{ ++ LATMParseContext *s = s1->priv_data; ++ ParseContext *pc = &s->pc; ++ int next; ++ ++ if(s1->flags & PARSER_FLAG_COMPLETE_FRAMES){ ++ next = buf_size; ++ }else{ ++ next = latm_find_frame_end(s1, buf, buf_size); ++ ++ if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) { ++ *poutbuf = NULL; ++ *poutbuf_size = 0; ++ return buf_size; ++ } ++ } ++ *poutbuf = buf; ++ *poutbuf_size = buf_size; ++ return next; ++} ++ ++static int latm_split(AVCodecContext *avctx, ++ const uint8_t *buf, int buf_size) ++{ ++ int i; ++ uint32_t state= -1; ++ ++ for(i=0; ist && pes->stream->nb_streams == MAX_STREAMS) || + (pes->st && pes->st->discard == AVDISCARD_ALL) || +- code == 0x1be) /* padding_stream */ ++ code == 0x1be || code == 0x1fa) /* padding_stream */ + goto skip; + + /* stream not present in PMT */ +Index: ffmpeg-r22950/libavformat/mpegts.h +=================================================================== +--- ffmpeg-r22950/libavformat/mpegts.h (revision 22950) ++++ ffmpeg-r22950/libavformat/mpegts.h (working copy) +@@ -49,6 +49,7 @@ + #define STREAM_TYPE_PRIVATE_DATA 0x06 + #define STREAM_TYPE_AUDIO_AAC 0x0f + #define STREAM_TYPE_VIDEO_MPEG4 0x10 ++#define STREAM_TYPE_AUDIO_AAC_LATM 0x11 + #define STREAM_TYPE_VIDEO_H264 0x1b + #define STREAM_TYPE_VIDEO_VC1 0xea + #define STREAM_TYPE_VIDEO_DIRAC 0xd1 +Index: ffmpeg-r22950/libavformat/mpeg.c +=================================================================== +--- ffmpeg-r22950/libavformat/mpeg.c (revision 22950) ++++ ffmpeg-r22950/libavformat/mpeg.c (working copy) +@@ -287,7 +287,7 @@ /* find matching stream */ if (!((startcode >= 0x1c0 && startcode <= 0x1df) || (startcode >= 0x1e0 && startcode <= 0x1ef) || @@ -821,19 +879,20 @@ diff -Naur ffmpeg-r19067.orig/libavformat/mpeg.c ffmpeg-r19067/libavformat/mpeg. goto redo; if (ppos) { *ppos = url_ftell(s->pb) - 4; -@@ -446,6 +446,9 @@ +@@ -454,6 +454,9 @@ } else if(es_type == STREAM_TYPE_AUDIO_AAC){ codec_id = CODEC_ID_AAC; - type = CODEC_TYPE_AUDIO; + type = AVMEDIA_TYPE_AUDIO; + } else if(es_type == STREAM_TYPE_AUDIO_AAC_LATM){ + codec_id = CODEC_ID_AAC_LATM; + type = CODEC_TYPE_AUDIO; } else if(es_type == STREAM_TYPE_VIDEO_MPEG4){ codec_id = CODEC_ID_MPEG4; - type = CODEC_TYPE_VIDEO; -diff -Naur ffmpeg-r19067.orig/libavformat/mpeg.h ffmpeg-r19067/libavformat/mpeg.h ---- ffmpeg-r19067.orig/libavformat/mpeg.h 2009-01-19 10:46:40.000000000 -0500 -+++ ffmpeg-r19067/libavformat/mpeg.h 2009-06-01 12:39:48.000000000 -0400 + type = AVMEDIA_TYPE_VIDEO; +Index: ffmpeg-r22950/libavformat/mpeg.h +=================================================================== +--- ffmpeg-r22950/libavformat/mpeg.h (revision 22950) ++++ ffmpeg-r22950/libavformat/mpeg.h (working copy) @@ -53,6 +53,7 @@ #define STREAM_TYPE_PRIVATE_DATA 0x06 #define STREAM_TYPE_AUDIO_AAC 0x0f @@ -842,34 +901,3 @@ diff -Naur ffmpeg-r19067.orig/libavformat/mpeg.h ffmpeg-r19067/libavformat/mpeg. #define STREAM_TYPE_VIDEO_H264 0x1b #define STREAM_TYPE_AUDIO_AC3 0x81 -diff -Naur ffmpeg-r19067.orig/libavformat/mpegts.c ffmpeg-r19067/libavformat/mpegts.c ---- ffmpeg-r19067.orig/libavformat/mpegts.c 2009-05-31 04:47:40.000000000 -0400 -+++ ffmpeg-r19067/libavformat/mpegts.c 2009-06-01 12:39:48.000000000 -0400 -@@ -495,6 +495,7 @@ - { 0x04, CODEC_TYPE_AUDIO, CODEC_ID_MP3 }, - { 0x0f, CODEC_TYPE_AUDIO, CODEC_ID_AAC }, - { 0x10, CODEC_TYPE_VIDEO, CODEC_ID_MPEG4 }, -+ { 0x11, CODEC_TYPE_AUDIO, CODEC_ID_AAC_LATM }, - { 0x1b, CODEC_TYPE_VIDEO, CODEC_ID_H264 }, - { 0xd1, CODEC_TYPE_VIDEO, CODEC_ID_DIRAC }, - { 0xea, CODEC_TYPE_VIDEO, CODEC_ID_VC1 }, -@@ -933,7 +934,7 @@ - if (pes->st->discard == AVDISCARD_ALL || - !((code >= 0x1c0 && code <= 0x1df) || - (code >= 0x1e0 && code <= 0x1ef) || -- (code == 0x1bd) || (code == 0x1fd))) -+ (code == 0x1bd) || (code == 0x1fa) || (code == 0x1fd))) - goto skip; - pes->state = MPEGTS_PESHEADER_FILL; - pes->total_size = AV_RB16(pes->header + 4); -diff -Naur ffmpeg-r19067.orig/libavformat/mpegts.h ffmpeg-r19067/libavformat/mpegts.h ---- ffmpeg-r19067.orig/libavformat/mpegts.h 2009-05-30 23:02:12.000000000 -0400 -+++ ffmpeg-r19067/libavformat/mpegts.h 2009-06-01 12:39:48.000000000 -0400 -@@ -47,6 +47,7 @@ - #define STREAM_TYPE_PRIVATE_DATA 0x06 - #define STREAM_TYPE_AUDIO_AAC 0x0f - #define STREAM_TYPE_VIDEO_MPEG4 0x10 -+#define STREAM_TYPE_AUDIO_AAC_LATM 0x11 - #define STREAM_TYPE_VIDEO_H264 0x1b - #define STREAM_TYPE_VIDEO_VC1 0xea - #define STREAM_TYPE_VIDEO_DIRAC 0xd1