diff options
Diffstat (limited to 'loader/dshow/DS_AudioDecoder.c')
-rw-r--r-- | loader/dshow/DS_AudioDecoder.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/loader/dshow/DS_AudioDecoder.c b/loader/dshow/DS_AudioDecoder.c index 645c8b517b..b18b646160 100644 --- a/loader/dshow/DS_AudioDecoder.c +++ b/loader/dshow/DS_AudioDecoder.c @@ -11,7 +11,7 @@ #include "DS_Filter.h" struct DS_AudioDecoder -{ +{ WAVEFORMATEX in_fmt; AM_MEDIA_TYPE m_sOurType, m_sDestType; DS_Filter* m_pDS_Filter; @@ -44,22 +44,22 @@ DS_AudioDecoder * DS_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX* Setup_LDT_Keeper(); Setup_FS_Segment(); #endif - + this = malloc(sizeof(DS_AudioDecoder)); - + sz = 18 + wf->cbSize; this->m_sVhdr = malloc(sz); memcpy(this->m_sVhdr, wf, 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 = pWF->nChannels * (pWF->wBitsPerSample + 7) / 8; pWF->cbSize = 0; pWF->nAvgBytesPerSec = pWF->nBlockAlign * pWF->nSamplesPerSec; - + memcpy(&this->in_fmt,wf,sizeof(WAVEFORMATEX)); memset(&this->m_sOurType, 0, sizeof(this->m_sOurType)); @@ -100,7 +100,7 @@ DS_AudioDecoder * DS_AudioDecoder_Open(char* dllname, GUID* guid, WAVEFORMATEX* free(this); return NULL; } - + //Commit should be done before binary codec start this->m_pDS_Filter->m_pAll->vt->Commit(this->m_pDS_Filter->m_pAll); @@ -134,7 +134,7 @@ int DS_AudioDecoder_Convert(DS_AudioDecoder *this, const void* in_data, unsigned { unsigned int written = 0; unsigned int read = 0; - + if (!in_data || !out_data) return -1; @@ -185,7 +185,7 @@ int DS_AudioDecoder_GetSrcSize(DS_AudioDecoder *this, int dest_size) double efficiency =(double) this->in_fmt.nAvgBytesPerSec / (this->in_fmt.nSamplesPerSec*this->in_fmt.nBlockAlign); int frames = (int)(dest_size*efficiency); - + if (frames < 1) frames = 1; return frames * this->in_fmt.nBlockAlign; |