United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 5049129 RFE: DataLine.getFramePosition() should return long
5049129 : RFE: DataLine.getFramePosition() should return long

Details
Type:
Enhancement
Submit Date:
2004-05-18
Status:
Resolved
Updated Date:
2004-06-18
Project Name:
JDK
Resolved Date:
2004-06-18
Component:
client-libs
OS:
generic
Sub-Component:
javax.sound
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
5.0
Fixed Versions:
5.0

Related Reports
Relates:

Sub Tasks

Description
Name: fb126949			Date: 05/18/2004

The method DataLine.getFramePosition() returns an int value. This value, however, has a very limited range and will overflow (wrap-around) after 2 billion frames -- about 13:20 hours at CD quality, and even shorter for higher sample rates. During the following 13 hours, getFramePosition will report increasing negative numbers, until 0 is reached again.

One objective of Java Sound in Tiger is to stabilize the implementation and make it usable for long-term usage found in security software, telco usage, VoIP, and streaming audio like Internet Radio. This API flaw is a possible stopper for adoption of Java Sound for such applications.

The suggested fix is to add a method to interface DataLine:
    long getLongFramePosition()

This API caused failure of the new reliability tests (see bug #5047795). The implementation was changed to operate on longs internally, so that a fix for this bug just means to expose the already internally existing method.

======================================================================

                                    

Comments
PUBLIC COMMENTS

API deficiency fixed for tiger-rc.
                                     
2004-06-25
SUGGESTED FIX

Add new method to interface DataLine:
	long DataLine.getLongFramePosition();
                                     
2004-06-25
WORK AROUND

interprete negative frame position by adding 2^31 to it. However, this causes an ambiguity after the second wrap-around (i.e. after 39 hours).
                                     
2004-06-25
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
tiger-rc

FIXED IN:
tiger-rc

INTEGRATED IN:
tiger-b57
tiger-rc


                                     
2004-06-25
EVALUATION

Deficiency in the API, should get fixed asap. Maybe even for tiger?
###@###.### 2004-05-18
                                     
2004-05-18



Hardware and Software, Engineered to Work Together