[vorbis-dev] XMMS plugin patch

Peter Alm peter at xmms.org
Mon Oct 11 04:56:05 PDT 1999



Hi,

I fixed the distorted audio bug in the XMMS plugin. A small follows
below:

--- vorbis.c.orig	Mon Oct 11 04:05:14 1999
+++ vorbis.c	Mon Oct 11 13:47:42 1999
@@ -161,7 +161,7 @@
    
    /* XXX figure out something to put for the bitrate and how to calculate the length of the stream */
    vorbis_ip.output->open_audio(FMT_S16_LE, od.vi.rate, od.vi.channels);
-   vorbis_ip.set_info(filename, 128000, 0, od.vi.rate, od.vi.channels);
+   vorbis_ip.set_info(filename, -1, 128000, od.vi.rate, od.vi.channels);
    
    while(i < 2) {
       while(i < 2 && ogg_sync_pageout(&od.oy, &od.og) == 1) {
@@ -219,9 +219,11 @@
             vorbis_synthesis(&od.vb, &od.op);
             vorbis_synthesis_blockin(&od.vd, &od.vb);
             if((samples = vorbis_synthesis_pcmout(&od.vd, &pcm)) > 0) {
+	       gint16 *outptr = pcmout;
+	       
                for(s = 0; s < samples; s++)
                  for(c = 0; c < od.vi.channels; c++)
-		   pcmout[(s * od.vi.channels + c) * sizeof(gshort)] = pcm[c][s] * 32767;
+		   *(outptr++) = pcm[c][s] * 32767;
                
                vorbis_audio_out(pcmout, samples * od.vi.channels * sizeof(gshort), od.vi.channels);
                vorbis_synthesis_read(&od.vd, samples);

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/



More information about the Vorbis-dev mailing list