Commit 89d4e14c authored by Bruno Jesus's avatar Bruno Jesus Committed by Alexandre Julliard

quartz: Take MP3 padding bit into account when calculating the block size.

parent 01ecb583
......@@ -367,6 +367,7 @@ static HRESULT MPEGSplitter_init_audio(MPEGSplitterImpl *This, const BYTE *heade
int freq_index;
int mode_ext;
int emphasis;
int padding;
int lsf = 1;
int mpeg1;
int layer;
......@@ -391,6 +392,7 @@ static HRESULT MPEGSplitter_init_audio(MPEGSplitterImpl *This, const BYTE *heade
layer = 4-((header[1]>>1)&0x3);
bitrate_index = ((header[2]>>4)&0xf);
padding = ((header[2]>>1)&0x1);
freq_index = ((header[2]>>2)&0x3) + (mpeg1?(lsf*3):6);
mode = ((header[3]>>6)&0x3);
mode_ext = ((header[3]>>4)&0x3);
......@@ -419,12 +421,12 @@ static HRESULT MPEGSplitter_init_audio(MPEGSplitterImpl *This, const BYTE *heade
if (layer == 3)
format->nBlockAlign = format->nAvgBytesPerSec * 8 * 144 /
(format->nSamplesPerSec<<lsf) + 1;
(format->nSamplesPerSec<<lsf) + padding;
else if (layer == 2)
format->nBlockAlign = format->nAvgBytesPerSec * 8 * 144 /
format->nSamplesPerSec + 1;
format->nSamplesPerSec + padding;
else
format->nBlockAlign = 4 * (format->nAvgBytesPerSec * 8 * 12 / format->nSamplesPerSec + 1);
format->nBlockAlign = 4 * (format->nAvgBytesPerSec * 8 * 12 / format->nSamplesPerSec + padding);
format->wBitsPerSample = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment