diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2013-01-01 16:59:21 +0400 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2013-01-01 16:59:21 +0400 |
commit | 47dfab35027c0f4539c3fc53d73afe45cf671b2b (patch) | |
tree | c5948f0ef7f357ca8cc6b9a041419970d6c05c51 /demuxer | |
parent | 0cb244f01a3379e253b260e7268aeda3d2e489f8 (diff) |
Improve support for multi-channel AAC in MPEG-TS
Diffstat (limited to 'demuxer')
-rw-r--r-- | demuxer/Demuxers/LAVFStreamInfo.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/demuxer/Demuxers/LAVFStreamInfo.cpp b/demuxer/Demuxers/LAVFStreamInfo.cpp index 77eaa314..d4c9f2d4 100644 --- a/demuxer/Demuxers/LAVFStreamInfo.cpp +++ b/demuxer/Demuxers/LAVFStreamInfo.cpp @@ -110,9 +110,17 @@ STDMETHODIMP CLAVFStreamInfo::CreateAudioMediaType(AVFormatContext *avctx, AVStr mtypes.push_back(mtype); mtype.subtype = MEDIASUBTYPE_DOLBY_TRUEHD_ARCSOFT; } else if (avstream->codec->codec_id == AV_CODEC_ID_AAC) { - mtype.subtype = MEDIASUBTYPE_AAC_ADTS; - wvfmt->wFormatTag = (WORD)mtype.subtype.Data1; - mtypes.push_back(mtype); + wvfmt->wFormatTag = (WORD)MEDIASUBTYPE_AAC_ADTS.Data1; + + CMediaType adtsMtype = mtype; + adtsMtype.subtype = MEDIASUBTYPE_AAC_ADTS; + // Clear artificially generated extradata so we don't confuse LAV Audio + if (m_containerFormat == "mpeg" || m_containerFormat == "mpegts") { + adtsMtype.cbFormat = sizeof(WAVEFORMATEX); + ((WAVEFORMATEX *)adtsMtype.pbFormat)->cbSize = 0; + } + mtypes.push_back(adtsMtype); + mtype.subtype = MEDIASUBTYPE_AAC; wvfmt->wFormatTag = (WORD)mtype.subtype.Data1; } else if (avstream->codec->codec_id == AV_CODEC_ID_AAC_LATM) { |