Jump to content
  • Advertisement
Sign in to follow this  

OpenSL GetPosition()

This topic is 2025 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a problem with OpenSL on various different Android devices.


The OpenSL spec states that SLPlayItf::GetPosition() should return "the position of the playback head relative to the beginning of the content, expressed in milliseconds... In the case where the data source is a buffer queue, the current position is the cumulative duration of all buffers since the last buffer queue Clear() method".


However, on some devices (Nexus 7, HTC One) this is not the case. GetPosition() only takes the current buffer into account, not all that have passed. In fact, the only devices that seem to impliment GetPosition() correctly are Samsung ones. Android version doesn't seem to be an issue here.


Obviously it's easy enough to cope with one or the other, the problem is detecting if the bug is present or not. Unfortunatly it seems that the position can be reported as over the end of the current buffer even if the bug is present if the app gets paused (by switching or attaching a debugger), so that can't be used to detect correct implimentation.


Has anyone else encountered this issue and got round it in a clever manner?

Edited by subi211

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!