Giter VIP home page Giter VIP logo

Comments (5)

lordmulder avatar lordmulder commented on August 22, 2024

Update:

Problem is caused by the following line returning NULL and memset'ing the frameInfo to all zero:

sample_buffer = NeAACDecDecode(hDecoder, &frameInfo, mp4config.bitbuf.data, mp4config.bitbuf.size);

We get division by zero, because frameInfo.channels is zero, but frameInfo.samples is zero too.

But I guess the "real" problem here is that the returned sample_buffer ends up being NULL.

The first couple of calls to NeAACDecDecode() do not return NULL though!

I tried to insert a continue statement in case that sample_buffer is NULL, but it results in infinite loop.

(So, once NULL was returned, all subsequent calls return NULL as well)

from faad2.

fabiangreffrath avatar fabiangreffrath commented on August 22, 2024

I guess the decoder should simply abort if there is an AAC frame that it cannot parse.

I tried to insert a continue statement in case that sample_buffer is NULL, but it results in infinite loop.

What if you add break there?

from faad2.

lordmulder avatar lordmulder commented on August 22, 2024

If I add a break, then it will stop decoding very quickly and leave an (almost) empty WAV file.

My guess: The new MP4 parsing code introduced in FAAD v2.8 does not support MP4 files containing a video stream – or, more generally, MP4 files with more than a single stream – yet.

If we have more than one stream, the "MDAT" atom of the MP4 file will contain chunks of the various streams, in an interleaved fashion. For this reason, it is necessary to parse the chunk offsets and lengths from the tables in the "MOOV" atom, and then jump to the chunks belonging to the desired stream.

Simply assuming that the "MDAT" atom contains a sequence of AAC frames (all belonging to the same stream) is not going work for files with more than one stream! ...and thus for most MP4 files out there.

I hope this can be fixed, because otherwise we will be stuck with FAAD 2.7 😟

from faad2.

lordmulder avatar lordmulder commented on August 22, 2024

Just wondering, any chance for a fix? ❓

from faad2.

lordmulder avatar lordmulder commented on August 22, 2024

Bump ✨

from faad2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.