diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2012-07-31 23:34:47 +0400 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2012-07-31 23:35:17 +0400 |
commit | 8663770f6b3855484bec05b689ead87a775ce384 (patch) | |
tree | 492e4cf02a0417f9285abf9f56b4727875e5d262 /decoder/LAVAudio | |
parent | 217d4ac50ebd77811f6b4dd5e2f2f1647f530f8d (diff) |
Selectively request specific sample formats, instead of always requesting float.
Diffstat (limited to 'decoder/LAVAudio')
-rw-r--r-- | decoder/LAVAudio/LAVAudio.cpp | 14 | ||||
-rw-r--r-- | decoder/LAVAudio/LAVAudio.h | 2 |
2 files changed, 11 insertions, 5 deletions
diff --git a/decoder/LAVAudio/LAVAudio.cpp b/decoder/LAVAudio/LAVAudio.cpp index b191f3fc..b6f91627 100644 --- a/decoder/LAVAudio/LAVAudio.cpp +++ b/decoder/LAVAudio/LAVAudio.cpp @@ -1185,9 +1185,17 @@ HRESULT CLAVAudio::ffmpeg_init(CodecID codec, const void *format, const GUID for if (m_pAVCodec->capabilities & CODEC_CAP_TRUNCATED) m_pAVCtx->flags |= CODEC_FLAG_TRUNCATED; -#if REQUEST_FLOAT - m_pAVCtx->request_sample_fmt = AV_SAMPLE_FMT_FLT; -#endif + if ( codec == CODEC_ID_AAC + || codec == CODEC_ID_AC3 + || codec == CODEC_ID_ATRAC3 + || codec == CODEC_ID_DTS + || codec == CODEC_ID_OPUS + || codec == CODEC_ID_NELLYMOSER + || codec == CODEC_ID_VORBIS) { + m_pAVCtx->request_sample_fmt = AV_SAMPLE_FMT_FLT; + } else if (codec == CODEC_ID_ALAC) { + m_pAVCtx->request_sample_fmt = AV_SAMPLE_FMT_S32P; + } // We can only trust LAV Splitters LATM AAC header... BOOL bTrustExtraData = TRUE; diff --git a/decoder/LAVAudio/LAVAudio.h b/decoder/LAVAudio/LAVAudio.h index 68ac5879..610cfa6f 100644 --- a/decoder/LAVAudio/LAVAudio.h +++ b/decoder/LAVAudio/LAVAudio.h @@ -33,8 +33,6 @@ // 192000 (Samples) * 4 (Bytes per Sample) * 8 (channels) #define LAV_AUDIO_BUFFER_SIZE 6144000 -#define REQUEST_FLOAT 1 - // Maximum Durations (in reference time) // 10ms (DTS has 10.6667 ms samples, don't want to queue them up) #define PCM_BUFFER_MAX_DURATION 100000 |