[haiku-development] BPushGameSound trouble

  • From: Krzysiek Ćwiertnia <krzysiek.bmkx@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 7 Dec 2009 19:34:32 +0100

Hi,

In the ticket here: http://dev.haiku-os.org/ticket/5093 I've posted
two patches. While first is very simple, I'm not really sure about the
second one, as it changes some interfaces (private though).
What is this all about:
BPushGameSound as it is now has pretty broken functionality of
tracking current position in played buffer. And this functionality is
crucial for playing sound, using "LockForCyclic()" method ("The
Neverending Story" in BeBook :) ). To cut a long story short: current
position in BPushGameSound is advanced each buffer fragment is played.
And these should be of length that is passed in constructor as
parameter. But in Haiku currently this parameter is only used to
calculate length of whole buffer. And the fragments (which are created
in GameProducer) have always default length (4096 bytes). Consider
what's happening if user creates BPushGameSound that happen to have
internal buffer exactly 4096 bytes length - current position will
always be 0...
Anyway, also in BeBook, in introduction to BPushGameSound there is
mentioned how it should all work. And in my second patch I've tried to
achieve such functionality. Unfortunately, like I wrote earlier, this
involves changing some methods prototypes, making some private members
protected, etc. Maybe there is some other way to achieve that, that'll
not break anything.
Oh, and I already see that Axel wrote that it breaks API :). Oh well.
So, any hints, thoughts?
Regards,
Krzysiek

Other related posts:

  • » [haiku-development] BPushGameSound trouble - Krzysiek Ćwiertnia