summaryrefslogtreecommitdiffstats
path: root/loader
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-12-31 04:35:20 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-12-31 04:35:20 +0000
commit8f4ee183e246ae54c208dd68c365f32bf9402246 (patch)
tree34f19e4345d9d4d5f07148b672a68e6cb25aab77 /loader
parent7480831c84ea54d0a22a1ccf86c9a21f31d1c5fb (diff)
downloadmpv-8f4ee183e246ae54c208dd68c365f32bf9402246.tar.bz2
mpv-8f4ee183e246ae54c208dd68c365f32bf9402246.tar.xz
ACEL.P fixed (avifile sync)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3916 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'loader')
-rw-r--r--loader/dshow/DS_AudioDecoder.c16
1 files changed, 10 insertions, 6 deletions
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;