Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Filling the secondaryBuffer properly?

1 view
Skip to first unread message

SteveR

unread,
Jul 13, 2009, 9:58:01 AM7/13/09
to
Is the following logic for filling the secondaryBuffer correct?

I've put notifications (10) at the end of each sector
I fill the buffer completely and then start play() with looping
As each notification is triggered, I write from the last position (initially
0) to the CurrentPlayPosition-1
I save the last position as CurrentPlayPosition and wait for the next
notification

So, I'm writing before and up to the CurrentPlayPosition. I'm also not
locking anything when I write to the SecondaryBuffer.

I was a little confused to find the CurrentWritePosition was a little larger
than the CurrentPlayPosition. I'm essentially ignoring the
CurrentWritePosition.

Thanks for any advice here.

Chris P.

unread,
Jul 16, 2009, 6:14:01 PM7/16/09
to

Sounds about right. Basically you can write anywhere in the buffer from
ahead of the CurrentWritePosition to end of buffer, and from start of
buffer to CurrentPlayPosition. You are responsible for tracking your own
write position for what you have written.

--
http://www.chrisnet.net/code.htm
[MS MVP for DirectShow / MediaFoundation]

0 new messages