From 8f4ee183e246ae54c208dd68c365f32bf9402246 Mon Sep 17 00:00:00 2001 From: arpi Date: Mon, 31 Dec 2001 04:35:20 +0000 Subject: ACEL.P fixed (avifile sync) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3916 b3059339-0415-0410-9bf9-f77b7e298cf2 --- loader/dshow/DS_AudioDecoder.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'loader') diff --git a/loader/dshow/DS_AudioDecoder.c b/loader/dshow/DS_AudioDecoder.c index 7726b293dc..c7461eb742 100644 --- a/loader/dshow/DS_AudioDecoder.c +++ b/loader/dshow/DS_AudioDecoder.c @@ -41,14 +41,15 @@ DS_AudioDecoder * DS_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX* sz = 18 + wf->cbSize; this->m_sVhdr = malloc(sz); memcpy(this->m_sVhdr, wf, sz); - this->m_sVhdr2 = malloc(sz); - memcpy(this->m_sVhdr2, this->m_sVhdr, sz); + this->m_sVhdr2 = malloc(18); + memcpy(this->m_sVhdr2, this->m_sVhdr, 18); pWF = (WAVEFORMATEX*)this->m_sVhdr2; pWF->wFormatTag = 1; pWF->wBitsPerSample = 16; - pWF->nBlockAlign = 2*pWF->nChannels; + pWF->nBlockAlign = pWF->nChannels * (pWF->wBitsPerSample + 7) / 8; pWF->cbSize = 0; + pWF->nAvgBytesPerSec = pWF->nBlockAlign * pWF->nSamplesPerSec; memcpy(&this->in_fmt,wf,sizeof(WAVEFORMATEX)); @@ -67,19 +68,22 @@ DS_AudioDecoder * DS_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX* memset(&this->m_sDestType, 0, sizeof(this->m_sDestType)); this->m_sDestType.majortype=MEDIATYPE_Audio; this->m_sDestType.subtype=MEDIASUBTYPE_PCM; - this->m_sDestType.subtype.f1=pWF->wFormatTag; +// this->m_sDestType.subtype.f1=pWF->wFormatTag; this->m_sDestType.formattype=FORMAT_WaveFormatEx; this->m_sDestType.bFixedSizeSamples=1; this->m_sDestType.bTemporalCompression=0; - this->m_sDestType.lSampleSize=2*wf->nChannels; + this->m_sDestType.lSampleSize=pWF->nBlockAlign; if (wf->wFormatTag == 0x130) // ACEL hack to prevent memory corruption // obviosly we are missing something here this->m_sDestType.lSampleSize *= 288; this->m_sDestType.pUnk=0; - this->m_sDestType.cbFormat=pWF->cbSize; + this->m_sDestType.cbFormat=18; //pWF->cbSize; this->m_sDestType.pbFormat=this->m_sVhdr2; +print_wave_header(this->m_sVhdr); +print_wave_header(this->m_sVhdr2); + /*try*/ { ALLOCATOR_PROPERTIES props, props1; -- cgit v1.2.3