Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4940459
Votes 0
Synopsis AudioInputStream.getFrameLength() returns 0 instead of NOT_SPECIFIED
Category java:classes_sound
Reported Against 1.4.2
Release Fixed 1.5(tiger-b26)
State 10-Fix Delivered, bug
Priority: 3-Medium
Related Bugs
Submit Date 20-OCT-2003
Description


FULL PRODUCT VERSION :
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)


FULL OS VERSION :
Linux shalmaneser 2.6.0-test8 #10 SMP Fri Oct 17 20:17:21 PDT 2003 i686 GNU/Linux

A DESCRIPTION OF THE PROBLEM :
When AudioInputStream is opened with a 16-bit linear PCM AU file that have a data_size equals to AUDIO_UNKNOWN_SIZE (-1), getFrameLength() returns 0 instead of AudioSystem.NOT_SPECIFIED.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.io.*;
import javax.sound.sampled.*;
import junit.framework.*;

public class MediaTest extends TestCase {
	public static Test suite() {
		return new TestSuite(MediaTest.class);
		}

	public void testAu()
		throws Exception {
			
		AudioInputStream is = AudioSystem.getAudioInputStream(new ByteArrayInputStream(new byte[] {
			(byte)0x2E, (byte)0x73, (byte)0x6E, (byte)0x64, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x18,
			(byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x03,
			(byte)0x00, (byte)0x00, (byte)0x1F, (byte)0x40, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x01,
			(byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00,
			}));
		assertTrue(is.getFrameLength() == AudioSystem.NOT_SPECIFIED);
		assertTrue(is.read(new byte[8]) == 8);
		assertTrue(is.read(new byte[2]) == -1);
		}
	}

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Replacing 0x9C by 0x9D at offset 0xB1E of com/sun/media/sound/AuFileReader.class in rt.jar
(Review ID: 216483) 
======================================================================
Work Around
N/A
Evaluation
Easy fix for tiger.
  xxxxx@xxxxx   2003-10-20
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang