[Vorbis-dev] Re: vorbis-tools broken

Ian Malone ibmalone at gmail.com
Sat Jul 14 04:46:31 PDT 2007


(Apologies to list maintainer, sent from wrong address first try.)
Ian Malone wrote:
 > It seems that oggdec in Fedora 7 produces a wav
 > header followed by lots of zeros.  Building
 > vorbis-tools 1.0.1 from source produces a working
 > oggdec, so I think the problem is in the
 > vorbis-tools package.
 >
 > I can't build vorbis-tools from svn due to some
 > make problems, but I can build the F7 SRPM.
 > There are no differences between the share and
 > oggdec directories, but there are autoconf
 > related changes.  Between 1.0.1 and svn there
 > are lots of changes involving channels.
 > Significantly, ogg123 works.
 >
 > Can anyone confirm this on another platform?
 >

Turns out I can build from trunk on FC6, and
the problem persists.  Appears to be due to
change 11666.

https://trac.xiph.org/changeset/11666

I can see what's happened: outbuf is written, but
only contains data if permute_channels was used.

Index: oggdec/oggdec.c
===================================================================
--- oggdec/oggdec.c     (revision 13259)
+++ oggdec/oggdec.c     (working copy)
@@ -255,6 +255,7 @@
      OggVorbis_File vf;
      int bs = 0;
      char buf[8192], outbuf[8192];
+    char *p_outbuf;
      int buflen = 8192;
      unsigned int written = 0;
      int ret;
@@ -324,9 +325,13 @@
          if(channels > 2 && !raw) {
            /* Then permute! */
            permute_channels(buf, outbuf, ret, channels, bits/8);
+         p_outbuf = outbuf;
          }
+       else {
+         p_outbuf = buf;
+       }

-        if(fwrite(outbuf, 1, ret, out) != ret) {
+        if(fwrite(p_outbuf, 1, ret, out) != ret) {
              fprintf(stderr, "Error writing to file: %s\n", 
strerror(errno));
              ov_clear(&vf);
              return 1;


More information about the Vorbis-dev mailing list