private void switchInputStream() throws IOException {
		if(getInputStream() != null)
			getInputStream().close();
		if(filenames.isEmpty())
			throw new IOException("All files in the playlist were marked as bad");
		if(random)
			current = (int)(Math.random() * filenames.size());
		else
			current = (current + 1) % filenames.size();
		try {
			Fluid.log("Playing: " + filenames.get(current), 1);
			setInputStream(new FileInputStream((String)filenames.get(current)));
		}
		catch(IOException e) {
			filenames.remove(current);
			throw e;
		}
	}