Add more recognized encodings.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 24 May 2013 21:30:53 +0000 (23:30 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 27 May 2013 20:54:37 +0000 (22:54 +0200)
src/main/java/net/pterodactylus/sonitus/data/sink/Icecast2Sink.java

index 0a5d22d..638e15b 100644 (file)
@@ -227,8 +227,8 @@ public class Icecast2Sink implements Sink {
        }
 
        /**
-        * Returns a MIME type for the given metadata. Currently only Vorbis, MP3, and
-        * PCM formats are recognized.
+        * Returns a MIME type for the given metadata. Currently only Vorbis, MP3, PCM,
+        * Ogg Vorbis, Opus, and FLAC formats are recognized.
         *
         * @param metadata
         *              The metadata to get a MIME type for
@@ -245,6 +245,15 @@ public class Icecast2Sink implements Sink {
                if ("PCM".equalsIgnoreCase(encoding)) {
                        return "audio/vnd.wave";
                }
+               if ("Vorbis".equalsIgnoreCase(encoding)) {
+                       return "application/ogg";
+               }
+               if ("Opus".equalsIgnoreCase(encoding)) {
+                       return "audio/ogg; codecs=opus";
+               }
+               if ("FLAC".equalsIgnoreCase(encoding)) {
+                       return "audio/flac";
+               }
                return "application/octet-stream";
        }