icculus/mojoAL

Offset is incorrectly reset after each processed buffer?

ivan-mogilko opened this issue · 1 comments

Hello.

According to the OpenAL specs found here, documentation for AL_SEC_OFFSET (page 39) sais:

The position is relative to the beginning of all the queued buffers for the source, and any
queued buffers traversed by a set call will be marked as processed.

At the same time mojoAL resets the source offset after each processed buffer:

mojoAL/mojoal.c

Line 1455 in 4203503

src->offset = 0;

Is that a mistake?

I'm sorry, I just realized that was mistaken about how this works in mojoAL.
What i missed is that in source_get_offset the returned offset is already summed with the lengths of the processed buffers (if there's a queue of these):

mojoAL/mojoal.c

Line 4208 in 4203503

offset = (proc_buf * item->buffer->len + src->offset);