Skip to content

Commit

Permalink
FLAC : Remove the isLast flag from the header when writing metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeugma440 committed Nov 4, 2024
1 parent 5662967 commit ea245b3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ATL/AudioData/IO/FLAC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,14 @@ private Tuple<bool, TagData> prepareWrite(Stream r, TagData tag)

private void postWrite(Stream w)
{
// Remove the isLast flag from the header
if (latestBlockOffset > header.Offset + 4)
{
w.Seek(header.Offset + 4, SeekOrigin.Begin);
byte b = (byte)w.ReadByte();
w.Seek(-1, SeekOrigin.Current);
w.WriteByte((byte)(b & ~FLAG_LAST_METADATA_BLOCK));
}
setIsLast(w);
}

Expand Down

0 comments on commit ea245b3

Please sign in to comment.