diff options
Diffstat (limited to 'libMpegTPEnc/src')
-rw-r--r-- | libMpegTPEnc/src/tpenc_asc.cpp | 4 | ||||
-rw-r--r-- | libMpegTPEnc/src/tpenc_lib.cpp | 12 | ||||
-rw-r--r-- | libMpegTPEnc/src/version | 2 |
3 files changed, 12 insertions, 6 deletions
diff --git a/libMpegTPEnc/src/tpenc_asc.cpp b/libMpegTPEnc/src/tpenc_asc.cpp index 93aa8ad..5ba71c8 100644 --- a/libMpegTPEnc/src/tpenc_asc.cpp +++ b/libMpegTPEnc/src/tpenc_asc.cpp @@ -255,7 +255,7 @@ int transportEnc_writePCE(HANDLE_FDK_BITSTREAM hBs, if ( matrixMixdownA!=0 && ((channelMode==MODE_1_2_2)||(channelMode==MODE_1_2_2_1)) ) { FDKwriteBits(hBs, 1, 1); /* Matrix mixdown present */ FDKwriteBits(hBs, (matrixMixdownA-1)&0x3, 2); /* matrix_mixdown_idx */ - FDKwriteBits(hBs, pseudoSurroundEnable&0x1, 1); /* pseudo_surround_enable */ + FDKwriteBits(hBs, (pseudoSurroundEnable)?1:0, 1); /* pseudo_surround_enable */ } else { FDKwriteBits(hBs, 0, 1); /* Matrix mixdown not present */ @@ -379,7 +379,7 @@ int transportEnc_writeGASpecificConfig( /* Write PCE if channel config is not 1-7 */ if (getChannelConfig(config->channelMode) == 0) { - transportEnc_writePCE(asc, config->channelMode, config->samplingRate, 0, 1, 0, 0, alignAnchor); + transportEnc_writePCE(asc, config->channelMode, config->samplingRate, 0, 1, config->matrixMixdownA, (config->flags&CC_PSEUDO_SURROUND)?1:0, alignAnchor); } if (extFlg) { if (aot == AOT_ER_BSAC) { diff --git a/libMpegTPEnc/src/tpenc_lib.cpp b/libMpegTPEnc/src/tpenc_lib.cpp index 325d3c3..d0a2fec 100644 --- a/libMpegTPEnc/src/tpenc_lib.cpp +++ b/libMpegTPEnc/src/tpenc_lib.cpp @@ -150,12 +150,18 @@ C_ALLOC_MEM(Ram_TransportEncoder, TRANSPORTENC, 1) TRANSPORTENC_ERROR transportEnc_Open( HANDLE_TRANSPORTENC *phTpEnc ) { - HANDLE_TRANSPORTENC hTpEnc = GetRam_TransportEncoder(0); + HANDLE_TRANSPORTENC hTpEnc; - if ( hTpEnc == NULL ) { + if ( phTpEnc == NULL ){ return TRANSPORTENC_INVALID_PARAMETER; } + hTpEnc = GetRam_TransportEncoder(0); + + if ( hTpEnc == NULL ) { + return TRANSPORTENC_NO_MEM; + } + *phTpEnc = hTpEnc; return TRANSPORTENC_OK; } @@ -417,7 +423,7 @@ TRANSPORTENC_ERROR transportEnc_WriteAccessUnit( } /* Write PCE as first raw_data_block element */ - transportEnc_writePCE(&hTp->bitStream, hTp->config.channelMode, hTp->config.samplingRate, 0, 1, hTp->config.matrixMixdownA, hTp->config.flags & CC_PSEUDO_SURROUND, alignAnchor); + transportEnc_writePCE(&hTp->bitStream, hTp->config.channelMode, hTp->config.samplingRate, 0, 1, hTp->config.matrixMixdownA, (hTp->config.flags&CC_PSEUDO_SURROUND)?1:0, alignAnchor); if ( (hTp->transportFmt==TT_MP4_ADTS) && !hTp->writer.adts.protection_absent) { adtsWrite_CrcEndReg(&hTp->writer.adts, &hTp->bitStream, crcIndex); diff --git a/libMpegTPEnc/src/version b/libMpegTPEnc/src/version index e7bd1b1..d998903 100644 --- a/libMpegTPEnc/src/version +++ b/libMpegTPEnc/src/version @@ -2,7 +2,7 @@ /* library info */ #define TP_LIB_VL0 2 #define TP_LIB_VL1 3 -#define TP_LIB_VL2 0 +#define TP_LIB_VL2 1 #define TP_LIB_TITLE "MPEG Transport" #define TP_LIB_BUILD_DATE __DATE__ #define TP_LIB_BUILD_TIME __TIME__ |