jmbe
jmbe copied to clipboard
AMBEFrame is decoded twice
The AMBEFrame object is created twice, and hence fully processed twice. Rather than creating the AMBEFrame object and passing its reference down the line.
The get audio method used here takes frame data and creates a new AMBEFrame. However an instance of AMBEFrame is created just before this and can be passed it getAudio instead.
https://github.com/DSheirer/jmbe/blob/4e9a2955c5ff79edcb278e0366908b030ea72933/codec/src/main/java/jmbe/codec/ambe/AMBEAudioCodec.java#L72
Another getAudio method is available that already takes an AMBEFrame object. This way the frame is not decoded, error corrected, and processed twice.