diff options
author | v0lt <v0lt@users.sourceforge.net> | 2012-05-24 22:41:00 +0400 |
---|---|---|
committer | v0lt <v0lt@users.sourceforge.net> | 2012-05-24 22:41:00 +0400 |
commit | 828ade527928c0f47a727ba00bc74c0fd90c697a (patch) | |
tree | dc5da9b42f133b1d0b20ec38feb8fc3da072f566 /src/filters/parser/BaseSplitter | |
parent | a7626afc0ee12dd06a2e3f86797be75e06703a68 (diff) |
AudioParser: fixed and updated support for MLP
DTSAC3Source: added support for MLP
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@4869 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/filters/parser/BaseSplitter')
-rw-r--r-- | src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp b/src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp index 501a9515c..e79f950aa 100644 --- a/src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp +++ b/src/filters/parser/BaseSplitter/BaseSplitterFileEx.cpp @@ -700,22 +700,23 @@ bool CBaseSplitterFileEx::Read(ac3hdr& h, int len, CMediaType* pmt, bool find_sy // Parse TrueHD and MLP header
if (!AC3CoreOnly) {
BYTE buf[20];
- int m_channels;
- int m_samplerate;
- int m_framelength;
+ int channels;
+ int samplerate;
+ int framelength;
+ WORD bitdepth;
bool isTrueHD;
int fsize = 0;
ByteRead(buf, 20);
- fsize = ParseMLPHeader(buf, &m_samplerate, &m_channels, &m_framelength, &isTrueHD);
+ fsize = ParseMLPHeader(buf, &samplerate, &channels, &framelength, &bitdepth, &isTrueHD);
if (fsize) {
if (!pmt) {
return true;
}
- int m_bitrate = int ((fsize) * 8i64 * m_samplerate / m_framelength);
+ int bitrate = (int)(fsize * 8i64 * samplerate / framelength); // inaccurate, because fsize is not constant
pmt->majortype = MEDIATYPE_Audio;
pmt->subtype = isTrueHD ? MEDIASUBTYPE_DOLBY_TRUEHD : MEDIASUBTYPE_MLP;
@@ -723,10 +724,11 @@ bool CBaseSplitterFileEx::Read(ac3hdr& h, int len, CMediaType* pmt, bool find_sy WAVEFORMATEX* wfe = (WAVEFORMATEX*)pmt->AllocFormatBuffer(sizeof(WAVEFORMATEX));
wfe->wFormatTag = WAVE_FORMAT_UNKNOWN;
- wfe->nChannels = m_channels;
- wfe->nSamplesPerSec = m_samplerate;
- wfe->nAvgBytesPerSec = (m_bitrate + 4) /8;
+ wfe->nChannels = channels;
+ wfe->nSamplesPerSec = samplerate;
+ wfe->nAvgBytesPerSec = (bitrate + 4) /8;
wfe->nBlockAlign = fsize < WORD_MAX ? fsize : WORD_MAX;
+ wfe->wBitsPerSample = bitdepth;
wfe->cbSize = 0;
pmt->SetSampleSize(0);
|