Browse files

Add support for Mp3 Version 2.

  • Loading branch information...
1 parent 8d9e55b commit c8d26e478fb9e7ff76cd9c3133bb93dbbc1c7ac2 @loarabia committed Jun 27, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 MediaParsers.Desktop/MpegFrame.cs
  2. +1 −1 Mp3MediaStreamSource.SL4/Mp3MediaStreamSource.cs
View
2 MediaParsers.Desktop/MpegFrame.cs
@@ -305,7 +305,7 @@ public int FrameSize
return ((12 * this.Bitrate / this.SamplingRate) + this.Padding) * 4;
case 2:
case 3:
- return (144 * this.Bitrate / this.SamplingRate) + this.Padding;
+ return ((this.Version == 1 ? 144 : 72) * this.Bitrate / this.SamplingRate) + this.Padding;
default:
return -1;
}
View
2 Mp3MediaStreamSource.SL4/Mp3MediaStreamSource.cs
@@ -257,7 +257,7 @@ protected override void GetSampleAsync(MediaStreamType mediaStreamType)
// Grab the next frame
MpegFrame nextFrame = new MpegFrame(this.audioStream);
- if (nextFrame.Version == 1 && nextFrame.Layer == 3)
+ if ( (nextFrame.Version == 1 || nextFrame.Version == 2) && nextFrame.Layer == 3)
{
this.currentFrameStartPosition += MpegFrame.FrameHeaderSize;
this.currentFrame = nextFrame;

0 comments on commit c8d26e4

Please sign in to comment.