naudio / NLayer

MPEG 1 & 2 Decoder for Layers 1, 2, & 3
MIT License
123 stars 30 forks source link

Fix LayerIIIDecoder.ReadSideInfo for reading only one granule on MPEG 2+ #6

Closed pferraris closed 6 years ago

pferraris commented 6 years ago

In LayerIII, when MPEG version is 2 or higher, the granule count must be 1. This is correctly implemented in method DecodeFrame of LayerIIIDecoder class, but not in method ReadSideInfo, causing data loss by increasing the frame offset. Fix #1

markheath commented 6 years ago

thanks for this. what testing have you performed with this change?

pferraris commented 6 years ago

I have used this change with a set of recordings generated by third-party software. All those are MPEG 2.5. But when testing with MPEG 2 files, I had other problems. It would be very helpful if other users could try this change, with their own files. I do not think that this change affects what was already working, but it does not solve 100% of the cases.