aboutsummaryrefslogtreecommitdiffstats
path: root/libMpegTPDec/src/tpdec_asc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libMpegTPDec/src/tpdec_asc.cpp')
-rw-r--r--libMpegTPDec/src/tpdec_asc.cpp27
1 files changed, 22 insertions, 5 deletions
diff --git a/libMpegTPDec/src/tpdec_asc.cpp b/libMpegTPDec/src/tpdec_asc.cpp
index 5270f2b..28bc22d 100644
--- a/libMpegTPDec/src/tpdec_asc.cpp
+++ b/libMpegTPDec/src/tpdec_asc.cpp
@@ -1413,7 +1413,9 @@ static TRANSPORTDEC_ERROR EldSpecificConfig_Parse(CSAudioSpecificConfig *asc,
esc->m_useLdQmfTimeAlign = 1;
if (cb->cbSsc != NULL) {
ErrorStatus = (TRANSPORTDEC_ERROR)cb->cbSsc(
- cb->cbSscData, hBs, asc->m_aot, asc->m_extensionSamplingFrequency,
+ cb->cbSscData, hBs, asc->m_aot,
+ asc->m_samplingFrequency << esc->m_sbrSamplingRate,
+ asc->m_samplesPerFrame << esc->m_sbrSamplingRate,
1, /* stereoConfigIndex */
-1, /* nTimeSlots: read from bitstream */
eldExtLen, asc->configMode, &asc->SacConfigChanged);
@@ -1812,9 +1814,16 @@ static TRANSPORTDEC_ERROR UsacRsv60DecoderConfig_Parse(
if (usc->element[i].m_stereoConfigIndex > 0) {
if (cb->cbSsc != NULL) {
+ int samplesPerFrame = asc->m_samplesPerFrame;
+
+ if (usc->m_sbrRatioIndex == 1) samplesPerFrame <<= 2;
+ if (usc->m_sbrRatioIndex == 2)
+ samplesPerFrame = (samplesPerFrame * 8) / 3;
+ if (usc->m_sbrRatioIndex == 3) samplesPerFrame <<= 1;
+
/* Mps212Config() ISO/IEC FDIS 23003-3 */
if (cb->cbSsc(cb->cbSscData, hBs, asc->m_aot,
- asc->m_extensionSamplingFrequency,
+ asc->m_extensionSamplingFrequency, samplesPerFrame,
usc->element[i].m_stereoConfigIndex,
usc->m_coreSbrFrameLengthIndex,
0, /* don't know the length */
@@ -2181,8 +2190,9 @@ TRANSPORTDEC_ERROR AudioSpecificConfig_Parse(
case AOT_MPEGS:
if (cb->cbSsc != NULL) {
if (cb->cbSsc(cb->cbSscData, bs, self->m_aot, self->m_samplingFrequency,
- 1, -1, /* nTimeSlots: read from bitstream */
- 0, /* don't know the length */
+ self->m_samplesPerFrame, 1,
+ -1, /* nTimeSlots: read from bitstream */
+ 0, /* don't know the length */
self->configMode, &self->SacConfigChanged)) {
return TRANSPORTDEC_UNSUPPORTED_FORMAT;
}
@@ -2365,10 +2375,17 @@ static TRANSPORTDEC_ERROR Drm_xHEAACDecoderConfig(
/*usc->element[elemIdx].m_stereoConfigIndex =*/FDKreadBits(hBs, 2);
if (usc->element[elemIdx].m_stereoConfigIndex > 0) {
if (cb->cbSsc != NULL) {
+ int samplesPerFrame = asc->m_samplesPerFrame;
+
+ if (usc->m_sbrRatioIndex == 1) samplesPerFrame <<= 2;
+ if (usc->m_sbrRatioIndex == 2)
+ samplesPerFrame = (samplesPerFrame * 8) / 3;
+ if (usc->m_sbrRatioIndex == 3) samplesPerFrame <<= 1;
+
ErrorStatus = (TRANSPORTDEC_ERROR)cb->cbSsc(
cb->cbSscData, hBs,
AOT_DRM_USAC, /* syntax differs from MPEG Mps212Config() */
- asc->m_extensionSamplingFrequency,
+ asc->m_extensionSamplingFrequency, samplesPerFrame,
usc->element[elemIdx].m_stereoConfigIndex,
usc->m_coreSbrFrameLengthIndex, 0, /* don't know the length */
asc->configMode, &asc->SacConfigChanged);