[vorbis-dev] Streaming buffers/ov_read question

Olaf van der Spek Olaf at XCC.TMFWeb.NL
Sun Jul 8 01:54:03 PDT 2001



> lpdsBuffer->Lock(0, 4096, (void **)&ptr1, &len1, (void
> **)&ptr2, &len2, DSBLOCK_FROMWRITECURSOR);

IIRC this flag (DSBLOCK_FROMWRITECURSOR) does not return the position from
where you last wrote, but where it is safe to write. I think you have to
keep the offset you're writing too in a var and pass that to Lock()>

>
> memcpy(ptr1, pcmData, len1);
>
> if (ptr2 != NULL)
> {
> memcpy(ptr2, pcmData+len1, len2);
> }
>
> lpdsBuffer->Unlock((void **)&ptr1, len1, (void **)&ptr2,
> len2);
>
> if (bStop)
> break;
>
> if (begPlay)
> {
> lpdsBuffer->Play(0, 0, DSBPLAY_LOOPING);
> begPlay = false;
> }
> }
>
> Thanks for any help.
>
> Akshay Dhalwala
>
> -----Original Message-----
> From: owner-vorbis-dev at xiph.org [mailto:owner-vorbis-dev at xiph.org] On
> Behalf Of Monty
> Sent: Saturday, July 07, 2001 10:41 AM
> To: vorbis-dev at xiph.org
> Subject: Re: [vorbis-dev] Streaming buffers/ov_read question
>
>
>
>
> On Thu, Jul 05, 2001 at 11:36:16AM -0700, Akshay Dhalwala wrote:
> > Has anyone had experience using ov_read in a thread with streaming
> > directsound buffers?  i have tried the following, but it just produces
> a
> > repeating garbage noise.  i would appreciate some help.
>
> "Your code is buggy".  I can spot two major problems with either of
> your loops functioning as intended right off the bat.  Problem A: [I
> may not be intuiting lpdsBuffer->Lock behavior properly but] it looks
> like none of the Ogg code is actually getting called. Once that's
> fixed (or verified working properly), Problem B: you're not adjusting
> the buffer segment passed to ov_read based on bytes already read.
>
> That's just from reading it once through.  There may be more problems
> lurking; spend some time with a debugger please.
>
> Monty
>
>
>
>
> --- >8 ----
> List archives:  http://www.xiph.org/archives/
> Ogg project homepage: http://www.xiph.org/ogg/
> To unsubscribe from this list, send a message to
'vorbis-dev-request at xiph.org'
> containing only the word 'unsubscribe' in the body.  No subject is needed.
> Unsubscribe messages sent to the list will be ignored/filtered.
>

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list