Hello Thomas,

Sunday, July 01, 2001, 4:32:18 PM, you wrote:

TH> I am using 0.53.5.

TH> Thanks for looking into this.

Try this patch ( apply it in lib/audioencoder directory ):

--- mp3encoder.cpp.old  Tue Oct 10 11:31:36 2000
+++ mp3encoder.cpp      Thu May 17 15:18:43 2001
@@ -8,7 +8,7 @@
     in_fmt=*format;
     lame_init(&gf);
     gf.silent=1;
-    gf.padding=1;
+    gf.padding=2;
     gf.VBR=0;
     gf.in_samplerate=format->nSamplesPerSec;
     gf.num_channels=format->nChannels;
@@ -34,20 +34,39 @@
     gf.quality=quality;
     return 0;
 }
+struct __attribute__((__packed__)) strf_mp3 
+{
+        short wID;
+        int fdwFlags;
+        short  nBlockSize;
+        short  nFramesPerBlock;
+        short  nCodecDelay;
+};
+
 int MP3Encoder::GetFormatSize()
 {
-    return 18;
+    return 30;
 }
 int MP3Encoder::GetFormat(char* extension, int size)
 {
-    if(size<18)return -1;
+    if(size<30)return -1;
     WAVEFORMATEX wf;
     memcpy(&wf, &in_fmt, 18);
     wf.wFormatTag=0x55;
     wf.nAvgBytesPerSec=gf.brate*125;
     wf.nBlockAlign=1;
-    wf.cbSize=0;
+    wf.wBitsPerSample=0;
+    wf.cbSize=12;
     memcpy(extension, &wf, 18);
+    
+    lame_init_params(&gf);
+    mp3extra.wID             = 1;        //
+    mp3extra.fdwFlags        = 2;        // These values
+    mp3extra.nBlockSize      = gf.framesize;      // based on an
+    mp3extra.nFramesPerBlock = 1;        // old Usenet post!!
+    mp3extra.nCodecDelay     = 1393;     //
+    memcpy(extension+18, &mp3extra, 12); 
+
     return 0;
 }
 int MP3Encoder::Start()



-- 
Best regards,
 Eugene
mailto:[EMAIL PROTECTED] or [EMAIL PROTECTED]
[Team GADGET]  [Team Two Divided By Zero]  [Team Hackzone.ru]



_______________________________________________
Avifile mailing list
[EMAIL PROTECTED]
http://prak.org/mailman/listinfo/avifile

Reply via email to