diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2014-12-15 12:27:27 +0300 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2014-12-15 12:27:27 +0300 |
commit | 1bca810e04b5643742be762245299fab349e232d (patch) | |
tree | cff39dde7b0305e10b99e0d577409c80caace875 /decoder | |
parent | 57ca857ffbb5276ef5a38aad77888b16294eefea (diff) |
Fix bitdepth init logic for DTS decoding
Diffstat (limited to 'decoder')
-rw-r--r-- | decoder/LAVAudio/DTSDecoder.cpp | 1 | ||||
-rw-r--r-- | decoder/LAVAudio/LAVAudio.cpp | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/decoder/LAVAudio/DTSDecoder.cpp b/decoder/LAVAudio/DTSDecoder.cpp index edb60cf8..3779642f 100644 --- a/decoder/LAVAudio/DTSDecoder.cpp +++ b/decoder/LAVAudio/DTSDecoder.cpp @@ -406,6 +406,7 @@ HRESULT CLAVAudio::DecodeDTS(const BYTE * pDataBuffer, int buffsize, int &consum // TODO: get rid of these m_pAVCtx->sample_rate = HDSampleRate; m_pAVCtx->profile = profile; + m_pAVCtx->bits_per_raw_sample = bitdepth; // Send current input time to the delivery function out.rtStart = m_rtStartInputCache; diff --git a/decoder/LAVAudio/LAVAudio.cpp b/decoder/LAVAudio/LAVAudio.cpp index f251697a..89178f65 100644 --- a/decoder/LAVAudio/LAVAudio.cpp +++ b/decoder/LAVAudio/LAVAudio.cpp @@ -955,7 +955,13 @@ HRESULT CLAVAudio::GetMediaType(int iPosition, CMediaType *pMediaType) // Prefer bits_per_raw_sample if set, but if not, try to do a better guess with bits per coded sample int bits = m_pAVCtx->bits_per_raw_sample ? m_pAVCtx->bits_per_raw_sample : m_pAVCtx->bits_per_coded_sample; - LAVAudioSampleFormat lav_sample_fmt = m_pDTSDecoderContext ? SampleFormat_24 : get_lav_sample_fmt(sample_fmt, bits); + + LAVAudioSampleFormat lav_sample_fmt; + if (m_pDTSDecoderContext) { + bits = m_DTSBitDepth; + lav_sample_fmt = (m_DTSBitDepth == 24) ? SampleFormat_24 : SampleFormat_16; + } else + lav_sample_fmt = get_lav_sample_fmt(sample_fmt, bits); if (m_settings.MixingEnabled) { if (nChannels != av_get_channel_layout_nb_channels(m_settings.MixingLayout) |