AVAudioPlayer::setCurrentTime not working as expected

Originator:Florian.Reinhart
Number:rdar://7822429 Date Originated:02-Apr-2010
Status:Closed Resolved:23-Apr-2010
Product:iPhone SDK Product Version:3.1.3
Classification:Serious Bug Reproducible:Always
 
Summary: 
When calling setCurrentTime on a AVAudioPlayer object, which is currently playing a file, it jumps to the correct position, but querying currentTime after that returns wrong values.

Steps to Reproduce:
I have attached a sample project. The application plays an audio file and skips to entered position. The values of currentTime are retrieved every second using a timer and are output to the console.
Let the sound play for a few seconds and then tap the seek button, it seeks to the start (if the value in the text field isn't changed). The console output then shows negative values for currentTime.

Expected Results:
currentTime shouldn't have negative values, but instead return the actual time.

Actual Results:
currentTime is negative or hangs behind the actual current time of the playing file.

Regression:
Tested on iPhone 3GS with 3.1.2 and Simulator with 3.1.3 and 3.2 using GM iPhone SDK 3.2.

Notes:
Sample project is attached.
You may download the sample project here: http://dl.dropbox.com/u/80399/AudioTest.zip

Comments

iPad fix?

Presumably this fix is only available on the iPhone at this time. Any ideas when we can get the benefits of this fix for the iPad? This bug is blocking my iPad app....

By neildurant at July 29, 2010, 12:58 p.m. (reply...)

Fixed in iPhone OS 4.0 beta 2

The bug was fixed in iPhone OS 4 beta 2. There probably won't be a fix for iPhone OS 3.x. No workaround is known at the moment.

By Florian.Reinhart at April 22, 2010, 8:12 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!