From 0981bdaceb28749577da94215ba83857d161ed84 Mon Sep 17 00:00:00 2001 From: NetNerd Date: Fri, 1 Feb 2019 03:56:17 +1100 Subject: [PATCH] recognise MP3 Xing headers with 'Info' magic The header is the same, but used for CBR files by some encoders. --- NAudio/FileFormats/Mp3/XingHeader.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/NAudio/FileFormats/Mp3/XingHeader.cs b/NAudio/FileFormats/Mp3/XingHeader.cs index e6cc67d3..1b87a2ae 100644 --- a/NAudio/FileFormats/Mp3/XingHeader.cs +++ b/NAudio/FileFormats/Mp3/XingHeader.cs @@ -91,6 +91,14 @@ public static XingHeader LoadXingHeader(Mp3Frame frame) xingHeader.startOffset = offset; offset += 4; } + else if ((frame.RawData[offset + 0] == 'I') && + (frame.RawData[offset + 1] == 'n') && + (frame.RawData[offset + 2] == 'f') && + (frame.RawData[offset + 3] == 'o')) + { + xingHeader.startOffset = offset; + offset += 4; + } else { return null;