Hello !

Try to replace this (in VbrTag.c):
=== cut ===
        // Set unassigned toc value with its neighbor value
        for (i=0;i<nVbrNumFrames;i++)
        {
                // Calculate percentage
                int nPercent= i*(NUMTOCENTRIES-1)/nVbrNumFrames;

                // Calculate relative file postion, normalized to 0..255
                float fRelStreamPos=255*(float)pVbrFrames[i]/(float)lFileSize;

                // Just to be safe
                if (nPercent>=NUMTOCENTRIES) nPercent=NUMTOCENTRIES-1;
                if (fRelStreamPos>255) fRelStreamPos=255;

                // Assign toc entry value
                btToc[nPercent]=(BYTE)fRelStreamPos;
        }

        // Fix up empty fields (if we have less than 100 frames)
        for (i=1;i<NUMTOCENTRIES ;i++)
        {
                if (btToc[i]==0)
                        btToc[i]=btToc[i-1];
        }
=== cut ===
with
=== cut ===
        for (i=1;i<100;i++) // Don't touch zero point...
        {
                // Calculate frame from given percentage
                int frameNum=floor(0.01*i*nVbrNumFrames);

                //  Calculate relative file postion, normalized to 0..256!(?)
                float fRelStreamPos=256.0*(float)pVbrFrames[frameNum]/(float)lFileSize;

                // Just to be safe
                if (fRelStreamPos>255) fRelStreamPos=255;

                // Assign toc entry value
                btToc[i]=(BYTE)fRelStreamPos;
        }
=== cut ===
So we don't need to scan all frames...

Best regards,
 Sergey                          mailto:[EMAIL PROTECTED]


--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )

Reply via email to