mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2024-12-13 14:12:31 +00:00
Actually retain the audio data in FLAC
Signed-off-by: Serial <69764315+Serial-ATA@users.noreply.github.com>
This commit is contained in:
parent
804f8f42a9
commit
d4148cf5da
1 changed files with 4 additions and 0 deletions
|
@ -18,6 +18,9 @@ where
|
||||||
{
|
{
|
||||||
let mut tag = metaflac::Tag::read_from(&mut data)?;
|
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::VorbisComment);
|
||||||
tag.remove_blocks(BlockType::Picture);
|
tag.remove_blocks(BlockType::Picture);
|
||||||
tag.remove_blocks(BlockType::Padding);
|
tag.remove_blocks(BlockType::Padding);
|
||||||
|
@ -48,6 +51,7 @@ where
|
||||||
data.seek(SeekFrom::Start(0))?;
|
data.seek(SeekFrom::Start(0))?;
|
||||||
|
|
||||||
tag.write_to(&mut data)?;
|
tag.write_to(&mut data)?;
|
||||||
|
data.write_all(&*remaining)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue