diff options
-rw-r--r-- | loader/dshow/DS_AudioDecoder.c | 7 | ||||
-rw-r--r-- | loader/dshow/DS_VideoDecoder.c | 8 |
2 files changed, 10 insertions, 5 deletions
diff --git a/loader/dshow/DS_AudioDecoder.c b/loader/dshow/DS_AudioDecoder.c index 77519f7e89..7726b293dc 100644 --- a/loader/dshow/DS_AudioDecoder.c +++ b/loader/dshow/DS_AudioDecoder.c @@ -72,6 +72,10 @@ DS_AudioDecoder * DS_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX* this->m_sDestType.bFixedSizeSamples=1; this->m_sDestType.bTemporalCompression=0; this->m_sDestType.lSampleSize=2*wf->nChannels; + 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.pbFormat=this->m_sVhdr2; @@ -144,9 +148,9 @@ int DS_AudioDecoder_Convert(DS_AudioDecoder *this, const void* in_data, uint_t i Debug printf("DS_AudioDecoder::Convert() Error: null sample\n"); break; } + sample->vt->SetActualDataLength(sample, this->in_fmt.nBlockAlign); sample->vt->GetPointer(sample, (BYTE **)&ptr); memcpy(ptr, (const uint8_t*)in_data + read, this->in_fmt.nBlockAlign); - sample->vt->SetActualDataLength(sample, this->in_fmt.nBlockAlign); sample->vt->SetSyncPoint(sample, 1); sample->vt->SetPreroll(sample, 0); result = this->m_pDS_Filter->m_pImp->vt->Receive(this->m_pDS_Filter->m_pImp, sample); @@ -161,6 +165,7 @@ int DS_AudioDecoder_Convert(DS_AudioDecoder *this, const void* in_data, uint_t i sample->vt->Release((IUnknown*)sample); read+=this->in_fmt.nBlockAlign; written+=frame_size; + break; } if (size_read) *size_read = read; diff --git a/loader/dshow/DS_VideoDecoder.c b/loader/dshow/DS_VideoDecoder.c index 75c005b5c4..b99799f55a 100644 --- a/loader/dshow/DS_VideoDecoder.c +++ b/loader/dshow/DS_VideoDecoder.c @@ -152,14 +152,14 @@ DS_VideoDecoder * DS_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHEAD if (!flip) { - this->m_sVhdr2->bmiHeader.biHeight *= -1; this->iv.m_obh.biHeight *= -1; + this->m_sVhdr2->bmiHeader.biHeight = this->iv.m_obh.biHeight; result = this->m_pDS_Filter->m_pOutputPin->vt->QueryAccept(this->m_pDS_Filter->m_pOutputPin, &this->m_sDestType); if (result) { - printf("Decoder does not support upside-down frames\n"); - this->m_sVhdr2->bmiHeader.biHeight *= -1; + printf("Decoder does not support upside-down RGB frames\n"); this->iv.m_obh.biHeight *= -1; + this->m_sVhdr2->bmiHeader.biHeight = this->iv.m_obh.biHeight; } } @@ -280,9 +280,9 @@ int DS_VideoDecoder_DecodeInternal(DS_VideoDecoder *this, const void* src, int s } + sample->vt->SetActualDataLength(sample, size); sample->vt->GetPointer(sample, (BYTE **)&ptr); memcpy(ptr, src, size); - sample->vt->SetActualDataLength(sample, size); sample->vt->SetSyncPoint(sample, is_keyframe); sample->vt->SetPreroll(sample, pImage ? 0 : 1); // sample->vt->SetMediaType(sample, &m_sOurType); |