Actually retain the audio data in FLAC

Signed-off-by: Serial <69764315+Serial-ATA@users.noreply.github.com>
This commit is contained in:
Serial 2021-06-27 13:43:06 -04:00
parent 804f8f42a9
commit d4148cf5da

View file

@ -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(())
}