View Single Post
Old 11th November 2007, 20:10   #2405  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
Hi,
I found old (since 2003 ?) small bugs in MakeAVIS mode "store uncompressed audio".
1. in function convertToAVI, around line 666:

Code:
//      wfx->wBitsPerSample=WORD((avs_samples_per_second(vi)/avs_audio_channels(vi))<<3); // wrong
      wfx->wBitsPerSample=WORD((avs_bytes_per_audio_sample(vi)/avs_audio_channels(vi))<<3); // must be
2. in same function, around line 687:
Code:
//          LONG rawaudiolen=LONG((asample[1]-asample[0]+1)*avs_samples_per_second(vi)); // wrong
          LONG rawaudiolen=LONG((asample[1]-asample[0]+1)*avs_bytes_per_audio_sample(vi)); // must be

3. in function showProps, aroun line 909

Code:
//    sprintf(pomS,"Bits per sample: %i",(avs_samples_per_second(vi)/avs_audio_channels(vi))<<3); // wrong
    sprintf(pomS,"Bits per sample: %i",(avs_bytes_per_audio_sample(vi)/avs_audio_channels(vi))<<3); // must be
This way makeAVIS works fine in "store uncompressed audio" mode, but only if Bits per Sample is 8 or 16.

For 32 bit (integer or float) audio it produces non-playable avi.
Next fix should be else disable this mode (disable checkbox ?)
or implement internal (or Avisynth) resampling to 16 bit.
I am not guru of windows messages and controls.

Please put my "patch" to SVN
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick
I usually do not provide a technical support in private messages.
Fizick is offline   Reply With Quote