From: David ‘Bombe’ Roden Date: Tue, 28 May 2013 10:59:00 +0000 (+0200) Subject: Fix metadata handling. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=e4770209dfde37f9945041d3b21fdf4cf4b51755;p=sonitus.git Fix metadata handling. --- diff --git a/src/main/java/net/pterodactylus/sonitus/data/filter/ExternalMp3Decoder.java b/src/main/java/net/pterodactylus/sonitus/data/filter/ExternalMp3Decoder.java index f81d532..bc8e341 100644 --- a/src/main/java/net/pterodactylus/sonitus/data/filter/ExternalMp3Decoder.java +++ b/src/main/java/net/pterodactylus/sonitus/data/filter/ExternalMp3Decoder.java @@ -44,16 +44,11 @@ public abstract class ExternalMp3Decoder extends ExternalFilter { } @Override - public Metadata metadata() { - return super.metadata().encoding("PCM"); - } - - @Override public void open(Metadata metadata) throws IOException { checkNotNull(metadata, "metadata must not be null"); checkState(metadata.encoding().equalsIgnoreCase("MP3"), "source must be MP3-encoded"); - super.open(metadata); + super.open(metadata.encoding("PCM")); } } diff --git a/src/main/java/net/pterodactylus/sonitus/data/filter/ExternalMp3Encoder.java b/src/main/java/net/pterodactylus/sonitus/data/filter/ExternalMp3Encoder.java index 21654af..a5c6b7c 100644 --- a/src/main/java/net/pterodactylus/sonitus/data/filter/ExternalMp3Encoder.java +++ b/src/main/java/net/pterodactylus/sonitus/data/filter/ExternalMp3Encoder.java @@ -44,16 +44,11 @@ public abstract class ExternalMp3Encoder extends ExternalFilter { } @Override - public Metadata metadata() { - return super.metadata().encoding("MP3"); - } - - @Override public void open(Metadata metadata) throws IOException { checkNotNull(metadata, "metadata must not be null"); checkState(metadata.encoding().equalsIgnoreCase("PCM"), "source must be PCM-encoded"); - super.open(metadata); + super.open(metadata.encoding("MP3")); } }