From 2e7163759c75cab6ab5ffa04c13d32ccc95f9719 Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Sun, 30 Oct 2022 17:33:12 +0000 Subject: [PATCH] 8282463: javax/sound/sampled/Clip/DataPusherThreadCheck.java fails Reviewed-by: prr, serb --- .../jdk/javax/sound/sampled/Clip/DataPusherThreadCheck.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/jdk/javax/sound/sampled/Clip/DataPusherThreadCheck.java b/test/jdk/javax/sound/sampled/Clip/DataPusherThreadCheck.java index 733a317ab37..58e0f0d6011 100644 --- a/test/jdk/javax/sound/sampled/Clip/DataPusherThreadCheck.java +++ b/test/jdk/javax/sound/sampled/Clip/DataPusherThreadCheck.java @@ -28,6 +28,8 @@ import javax.sound.sampled.AudioFileFormat; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; +import javax.sound.sampled.Clip; +import javax.sound.sampled.DataLine; import java.applet.AudioClip; import java.io.ByteArrayInputStream; import java.io.File; @@ -49,6 +51,10 @@ public class DataPusherThreadCheck { try { AudioFormat format = new AudioFormat(PCM_SIGNED, 44100, 8, 1, 1, 44100, false); + DataLine.Info info = new DataLine.Info(Clip.class, format); + if (!(AudioSystem.isLineSupported(info)) ) { + return; // the test is not applicable + } int dataSize = 6000*1000 * format.getFrameSize(); InputStream in = new ByteArrayInputStream(new byte[dataSize]); AudioInputStream audioStream = new AudioInputStream(in, format, NOT_SPECIFIED);