[Vorbis-dev] Re: vorbis-tools 1.2.0 Release Candidate
Michael Gold
mgold at ncf.ca
Mon Feb 25 22:06:37 PST 2008
On Mon, Feb 25, 2008 at 15:48:23 +0000, Ian Malone wrote:
> I've found a double vcut case where the round-tripped files[1] are
> not equal. Looking at the difference there is an apparent time offset
> for a few seconds after the cut, after which the difference disappears
> again. (Unfortunately the file is not one I can distribute freely.)
>
> That said, vcut isn't built by default, is marked as experimental
> and I haven't managed to get it to crash or anything like that yet.
>
> [1]
> $ vcut source.ogg 1.ogg 2.ogg +(sometime)
> $ cat 1.ogg 2.ogg > 1+2.ogg
> $ oggdec source.ogg
> $ oggdec 1+2.ogg
> $ cmp source.wav 1+2.wav
> If all is okay then the two waves should compare equal.
> This has worked for most things I've tried.
Do both files have the same serial number? You can check using ogginfo.
I ran some tests and found that both streams would end up with the same
serial number if vcut was used within 1 second of encoding the file.
This code is used by vcut to assign the numbers:
ogg_stream_init(&stream_out_first,s->serial); /* first file gets original */
srand(time(NULL));
ogg_stream_init(&stream_out_second, rand()); /* second gets random */
And oggenc uses this code:
srand(time(NULL));
opt.serial = rand();
So both programs generate the same number while time(NULL) is the same,
and oggdec can't decode the concatenated file because of this. Modifying
oggenc and vcut to XOR the time with getpid() should be good enough to
fix this.
However, the steps you listed above only called vcut once. Using vcut on
1+2.ogg will generally fail because it has no support for files with
multiple logical streams. I didn't think of concatenating streams while
testing, but I'll see if I can add support for such files. This will
probably require some major changes, so it's not likely to be ready for
1.2.0.
-- Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.xiph.org/pipermail/vorbis-dev/attachments/20080226/e3b66dcc/attachment.pgp
More information about the Vorbis-dev
mailing list