From d4148cf5da53d78cb112cc7fbb701dec3fa9f4db Mon Sep 17 00:00:00 2001 From: Serial <69764315+Serial-ATA@users.noreply.github.com> Date: Sun, 27 Jun 2021 13:43:06 -0400 Subject: [PATCH] Actually retain the audio data in FLAC Signed-off-by: Serial <69764315+Serial-ATA@users.noreply.github.com> --- src/components/logic/flac.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/logic/flac.rs b/src/components/logic/flac.rs index bf55bdb2..f2694d55 100644 --- a/src/components/logic/flac.rs +++ b/src/components/logic/flac.rs @@ -18,6 +18,9 @@ where { let mut tag = metaflac::Tag::read_from(&mut data)?; + let mut remaining = Vec::new(); + data.read_to_end(&mut remaining)?; + tag.remove_blocks(BlockType::VorbisComment); tag.remove_blocks(BlockType::Picture); tag.remove_blocks(BlockType::Padding); @@ -48,6 +51,7 @@ where data.seek(SeekFrom::Start(0))?; tag.write_to(&mut data)?; + data.write_all(&*remaining)?; Ok(()) }