summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-11-21 12:59:33 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-11-21 12:59:33 +0100
commite322219b2057053be0cf72278062702df3886aaa (patch)
tree1f6128c29c7648967c690898b8f812abbc7b7a43
parent6914dcc31f90a1d3c152cf921ecd9dd2bc204513 (diff)
downloadfdk-aac-e322219b2057053be0cf72278062702df3886aaa.tar.gz
fdk-aac-e322219b2057053be0cf72278062702df3886aaa.tar.bz2
fdk-aac-e322219b2057053be0cf72278062702df3886aaa.zip
Place DSE first in AU
-rw-r--r--libAACenc/src/bitenc.cpp34
1 files changed, 27 insertions, 7 deletions
diff --git a/libAACenc/src/bitenc.cpp b/libAACenc/src/bitenc.cpp
index 6f2c151..0823ef2 100644
--- a/libAACenc/src/bitenc.cpp
+++ b/libAACenc/src/bitenc.cpp
@@ -1303,6 +1303,23 @@ AAC_ENCODER_ERROR FDKaacEnc_WriteBitstream(HANDLE_TRANSPORTENC hTpEnc,
frameBits = bitMarkUp = alignAnchor;
+ /* Write DSEs first in case of DAB */
+ for (n = 0; (n < qcOut->nExtensions) && (n < (2+2)); n++)
+ {
+ if ( (syntaxFlags & AC_DAB) &&
+ (qcOut->extension[n].type == EXT_DATA_ELEMENT) ) {
+ FDKaacEnc_writeExtensionData( hTpEnc,
+ &qcOut->extension[n],
+ 0,
+ alignAnchor,
+ syntaxFlags,
+ aot,
+ epConfig );
+ }
+
+ /* For EXT_FIL or EXT_FILL_DATA we could do an additional sanity check here */
+ }
+
/* Channel element loop */
for (i=0; i<channelMapping->nElements; i++) {
@@ -1445,13 +1462,16 @@ AAC_ENCODER_ERROR FDKaacEnc_WriteBitstream(HANDLE_TRANSPORTENC hTpEnc,
/* Write global extension payload and fill data */
for (n = 0; (n < qcOut->nExtensions) && (n < (2+2)); n++)
{
- FDKaacEnc_writeExtensionData( hTpEnc,
- &qcOut->extension[n],
- 0,
- alignAnchor,
- syntaxFlags,
- aot,
- epConfig );
+ if ( (syntaxFlags & AC_DAB) &&
+ (qcOut->extension[n].type != EXT_DATA_ELEMENT) ) {
+ FDKaacEnc_writeExtensionData( hTpEnc,
+ &qcOut->extension[n],
+ 0,
+ alignAnchor,
+ syntaxFlags,
+ aot,
+ epConfig );
+ }
/* For EXT_FIL or EXT_FILL_DATA we could do an additional sanity check here */
}