JDK-5049129 : RFE: DataLine.getFramePosition() should return long
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.sound
  • Affected Version: 5.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-05-18
  • Updated: 2017-05-16
  • Resolved: 2004-06-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
5.0 b57Fixed
Related Reports
Relates :  
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.


CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-rc FIXED IN: tiger-rc INTEGRATED IN: tiger-b57 tiger-rc

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).

SUGGESTED FIX Add new method to interface DataLine: long DataLine.getLongFramePosition();

PUBLIC COMMENTS API deficiency fixed for tiger-rc.

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