[vorbis-dev] ov_read() reading too little.

Andrew Chatham andrew.chatham at duke.edu
Wed Nov 29 13:02:49 PST 2000



Thus spake Monty (xiphmont at xiph.org) : 
> > After opening as "rb" instead of
> > "r", the ov_open() call works.  However, ov_read() seems to consistently
> > read less data than I ask for.  My buffer is enough to hold two seconds
> > of data, 16 bit 44k mono, that's 176400 bytes.  The first call to
> > ov_read() asks for that much but only gets 52,608 bytes.  The next call
> > asks for 3,652 bytes but only gets 2048.  Subsequent calls ask for more
> > and more, but still only get 2k.  Is this normal?  If so, it should be
> > documented.
> Nope, you're doing something wrong.  Can we see the code please?

I've seen the same thing doing Python bindings. If I change
vorbisfile_example.c from CVS, making pcmout 16 times bigger (so it's now 65536
bytes) and just printing the number of bytes read each time on stderr, I get:

"""
Track encoded by encoder_example.c

Bitstream is 2 channel, 44100Hz
Encoded by: Xiphophorus libVorbis I 20000508

65536
58112
4096
4096
4096
4096
4096
...
"""

There are a few 512's and 2304's in there too. I've tried with different,
recently encoded files, and they give similar results. I get the same results
with my code (not surprising, since I learned how to use vorbis_file from the
examples).


-- 
Andrew Chatham
Duke University '02
andrew.chatham at duke.edu

--- >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