While working with a weird format, I realized some issues with the decoding logic. In this format, every now and then, a bad frame pops out, which ffmpeg is able to ignore and keep decoding just fine.
On the other hand, with the binding, ignoring these frames resulted in chopped output. The reason being that, for each paquet submitted to the decoder, there can be multiple resulting frame. However, currently, the decoder code keeps parity between consumed paquets and decoded frame.
This PR fixes that logic, while cleaning up a little bit around. I'm gonna be testing it, let me know what you think.
Next, I would like to also cleanup the exception logic so that the application is able to catch the right exception (AVERROR_INVALIDDATA). I have a PR pending but it's not ready to merge yet.
While working with a weird format, I realized some issues with the decoding logic. In this format, every now and then, a bad frame pops out, which
ffmpeg
is able to ignore and keep decoding just fine.On the other hand, with the binding, ignoring these frames resulted in chopped output. The reason being that, for each paquet submitted to the decoder, there can be multiple resulting frame. However, currently, the decoder code keeps parity between consumed paquets and decoded frame.
This PR fixes that logic, while cleaning up a little bit around. I'm gonna be testing it, let me know what you think.
Next, I would like to also cleanup the exception logic so that the application is able to catch the right exception (
AVERROR_INVALIDDATA
). I have a PR pending but it's not ready to merge yet.