[vorbis-dev] Problem with seek functions,

OmegaDan omegadan at thehumbleguys.com
Mon Feb 12 02:17:45 PST 2001



no ... no threads ... what I would give to be able to do this project in
unix though :)

the offending function looks like this :

bool vorbisfile_interface::Read( double offset, int length, char *buffer)
{

        //enforce temporal consistancy -- must open file first :)
        if ( status == NOTINUSE ) { return FAILURE ; }

        if ( ov_time_seek(&ovf, offset ) !=0 ) { return FAILURE ; }

        int accum = 0 ;
        int actually_read ;

        while ( accum < length)
        {

                actually_read = ov_read( &ovf, &buffer[accum], length, 0,
2, 1, &stre$

                if( actually_read < 0 ) { return FAILURE ; }
                accum+=actually_read ;
        }

        return SUCCESS;

}

I did some more investigation this morning , and it seems to be that it
always fails when seeking to 0 seconds [returning the value 1].  However,
for anything other then 1, it seems to work <grin>

I'm pretty sure thats a bug in vorbisfile (I'm using the cvs from sat feb
10th)

Dan

On Mon, 12 Feb 2001, Michael Smith wrote:
> Date: Mon, 12 Feb 2001 19:25:01 +1100
> To: vorbis-dev at xiph.org
> From: Michael Smith <msmith at labyrinth.net.au>
> Reply-To: vorbis-dev at xiph.org
> Sender: owner-vorbis-dev at xiph.org
> Subject: Re: [vorbis-dev] Problem with seek functions,
> 
> At 04:54 PM 2/11/01 -0800, you wrote:
> >I am having trouble using vorbisfiles (under win32) ov_pcm_seek or
> >ov_time_seek (I haven't tried the other functions) ... both return -129
> >every time I use them (internal error).  
> 
> They should work fine (and they do - see the winamp plugin, for an
> example
> on win32). So it's very hard to say anything more specific without seeing
> some code - if you can supply a minimal test case, that'd be great.
> 
> As Brett mentioned, if you're seeking from a different thread you have to
> be careful (it's safe to do if you ARE careful, but you need a mutex
> around
> the vorbisfile structure (or equiv on win32. critical section?)
> 
> Michael
> 
> --- >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