Skip to content

Commit b27beab

Browse files
teekaydecriptor
authored andcommitted
Disregard case in Apple box names + initial unit test (#187)
1 parent e00eca6 commit b27beab

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/TaglibSharp.Tests/FileFormats/M4aFormatTest.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public Mpeg4TestFile (string path) : base (path)
2121
}
2222

2323
static readonly string sample_file = TestPath.Samples + "sample.m4a";
24+
static readonly string sample_file_rg = TestPath.Samples + "sample_replaygain.m4a";
2425
static readonly string tmp_file = TestPath.Samples + "tmpwrite.m4a";
2526
static readonly string aac_broken_tags = TestPath.Samples + "bgo_658920.m4a";
2627
TagLib.File file;
@@ -93,6 +94,13 @@ public void ReadTags ()
9394
Assert.AreEqual (1234, file.Tag.Year);
9495
}
9596

97+
[Test]
98+
public void ReadReplayGain()
99+
{
100+
var fileWithRg = TagLib.File.Create (sample_file_rg);
101+
Assert.AreEqual(-1.43, fileWithRg.Tag.ReplayGainTrackGain, 0.01);
102+
}
103+
96104
[Test]
97105
public void WriteStandardTags ()
98106
{
Binary file not shown.

src/TaglibSharp/Mpeg4/AppleTag.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ AppleDataBox GetDashAtoms (string meanstring, string namestring)
471471

472472
if (mean_box == null || name_box == null ||
473473
mean_box.Text != meanstring ||
474-
name_box.Text != namestring) {
474+
!name_box.Text.Equals (namestring, StringComparison.OrdinalIgnoreCase)) {
475475
continue;
476476
} else {
477477
return (AppleDataBox)box.GetChild (BoxType.Data);

0 commit comments

Comments
 (0)