[FFmpeg-devel] [PATCH] DVB LATM parser
Michael Niedermayer
michaelni
Wed Sep 17 02:51:18 CEST 2008
On Fri, Jul 04, 2008 at 09:28:37AM +1200, Paul Kendall wrote:
> On Thursday 03 July 2008 22:16:56 Paul Kendall wrote:
> > Hi attached is a patch that provides a AAC LATM parser CODEC_ID_AAC_LATM I
> > have been working on. The libfaad decoder is also patched to provide
> > another codec the decoding for this codec id. There are minor patches to
> > mpeg.c & mpegts.c to send stream id 0x11 to this codec id.
> >
> > With this patch I can get audio working perfectly for NZ DVB-T using the
> > stock unpatched libfaad2 library.
> >
> > I would welcome comments and suggestions so this can be included in the
> > ffmpeg codebase.
> >
> > Cheers,
> > Paul Kendall
>
> Doh!
> I missed a vital part of the patch! Putting the codec in the allcodecs.c file!
> Heres a modified patch.
I think a parser is not the correct place to remove the LATM stuff. A parser
should only split things into frames and extract information, not remove
information.
This for example is important if one wants to preserve the LATM and mux it
into another container.
LATM could be removed in a bitstream filter ....
besides the code below is exploitable
[...]
> +static void readPayloadLengthInfo(AACParser *parser, GetBitContext *b)
> +{
> + uint8_t tmp;
> + if (parser->frameLengthType == 0) {
> + parser->muxSlotLengthBytes = 0;
> + do {
> + tmp = get_bits(b, 8);
> + parser->muxSlotLengthBytes += tmp;
> + } while (tmp == 255);
> + } else {
> + if (parser->frameLengthType == 5 ||
> + parser->frameLengthType == 7 ||
> + parser->frameLengthType == 3) {
> + get_bits(b, 2);
> + }
> + }
> +}
[...]
> + readPayloadLengthInfo(parser, b);
> +
> + // copy data
> + for (j=0; j<parser->muxSlotLengthBytes; j++)
> + *payload++ = get_bits(b, 8);
> + *payloadsize = parser->muxSlotLengthBytes;
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I hate to see young programmers poisoned by the kind of thinking
Ulrich Drepper puts forward since it is simply too narrow -- Roman Shaposhnik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080917/4dd96d58/attachment.pgp>
More information about the ffmpeg-devel
mailing list