[vorbis-dev] bug report for oggenc in CVS: vorbis-tools/oggenc/encode.c

Cameron Simpson cs at zip.com.au
Sun Dec 2 21:13:04 PST 2001



I was wondering why my CD ripping was producing short files from some tracks.

A superficial examination of the code shows this piece of code in vorbis-tools/oggenc/encode.c:

Line 120:

                /* Main encode loop - continue until end of file */
        while(!eos)
        {
        [...]
                /* While we can get enough data from the library to analyse, one
                   block at a time... */
                while(vorbis_analysis_blockout(&vd,&vb)==1)
                {
                [...]
                        /* If we've gone over a page boundary, we can do actual output,
                           so do so (for however many pages are available) */

                        while(!eos)
                        {
                        [...]
                                if(ogg_page_eos(&og))
                                        eos = 1;
                        }
                }
        }

Now, backtracing through vorbis/lib, it seems to me that the inner eos is
being used to stop the output when we've temporarily run out of input,
which is fine. But the SAME eos flag is used to stop the outer loop. I
feel that either eos should be reset after the inner loop, or that there
should be a separate eos-like flag used for the inner loop.

Am I right of havs I misconstrued things. Certainly when I' getting short track rips:

        - the input raw data is _not_ all consumed

        - oggenc exits "normally", with a "Done encoding file message" just like it"s
          seen end of input

I'm off to rebuild oggenc to test this theory, but meanwhile would someone who
knows the code properly care to see if I'm right?

Thanks,

--
Cameron Simpson, DoD#743        cs at zip.com.au    http://www.zip.com.au/~cs/

"I'm a lawyer."   "Honest?"   "No, the usual kind."

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