Skip to content

Commit

Permalink
CodecFactory now supports upper case fileextensions(fixes #103). The …
Browse files Browse the repository at this point in the history
…flac decoder will now skip all ID3v2 tags(not just the first one).
  • Loading branch information
filoe committed Jun 5, 2016
1 parent 5de8517 commit de9f32f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CSCore/Codecs/CodecFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public IWaveSource GetCodec(string filename)
{
try
{
if (codecEntry.Value.FileExtensions.Contains(extension))
if (codecEntry.Value.FileExtensions.Any(x => x.Equals(extension, StringComparison.OrdinalIgnoreCase)))
return codecEntry.Value.GetCodecAction(File.OpenRead(filename));
}
catch (Exception ex)
Expand Down
4 changes: 3 additions & 1 deletion CSCore/Codecs/FLAC/FlacFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ public FlacFile(Stream stream, FlacPreScanMode scanFlag,
_stream = stream;

//skip ID3v2
ID3v2.SkipTag(stream);
while (ID3v2.SkipTag(stream))
{
}

//read fLaC sync
var beginSync = new byte[4];
Expand Down
2 changes: 1 addition & 1 deletion CSCore/Codecs/FLAC/FlacPreScan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private List<FlacFrameInformation> RunScan(FlacMetadataStreamInfo streamInfo)

private void RaiseScanFinished(List<FlacFrameInformation> frames)
{
EventHandler<FlacPreScanFinishedEventArgs> handler = this.ScanFinished;
EventHandler<FlacPreScanFinishedEventArgs> handler = ScanFinished;
if (handler != null)
handler(this, new FlacPreScanFinishedEventArgs(frames));
}
Expand Down

0 comments on commit de9f32f

Please sign in to comment.