Showing the changes to codec/decoder/plus/src/welsDecoderExt.cpp (1 of 11 files). Show all
Unified · Split
| @@ -243,6 +243,7 @@ int32_t CWelsDecoder::InitDecoder (const SDecodingParam* pParam) { · 242 unmodified lines | ||
| 243 | 243 | "CWelsDecoder::init_decoder(), openh264 codec version = %s, ParseOnly = %d", |
| 244 | 244 | VERSION_NUMBER, (int32_t)pParam->bParseOnly); |
| 245 | 245 | |
| 246 | + //reset decoder context | |
| 246 | 247 | if (m_pDecContext) //free |
| 247 | 248 | UninitDecoder(); |
| 248 | 249 | m_pDecContext = (PWelsDecoderContext)WelsMallocz (sizeof (SWelsDecoderContext), "m_pDecContext"); |
| @@ -252,8 +253,8 @@ int32_t CWelsDecoder::InitDecoder (const SDecodingParam* pParam) { · 3 unmodified lines | ||
| 252 | 253 | m_pDecContext->pMemAlign = new CMemoryAlign (iCacheLineSize); |
| 253 | 254 | WELS_VERIFY_RETURN_PROC_IF (1, (NULL == m_pDecContext->pMemAlign), UninitDecoder()) |
| 254 | 255 | |
| 255 | − WELS_VERIFY_RETURN_PROC_IF (cmInitParaError, WelsInitDecoder (m_pDecContext, pParam->bParseOnly, | |
| 256 | − &m_pWelsTrace->m_sLogCtx), UninitDecoder()) | |
| 256 | + //fill in default value into context | |
| 257 | + WelsDecoderDefaults (m_pDecContext, &m_pWelsTrace->m_sLogCtx); | |
| 257 | 258 | |
| 258 | 259 | //check param and update decoder context |
| 259 | 260 | m_pDecContext->pParam = (SDecodingParam*) m_pDecContext->pMemAlign->WelsMallocz (sizeof (SDecodingParam), |
| @@ -262,6 +263,9 @@ int32_t CWelsDecoder::InitDecoder (const SDecodingParam* pParam) { · 2 unmodified lines | ||
| 262 | 263 | int32_t iRet = DecoderConfigParam (m_pDecContext, pParam); |
| 263 | 264 | WELS_VERIFY_RETURN_IFNEQ (iRet, cmResultSuccess); |
| 264 | 265 | |
| 266 | + //init decoder | |
| 267 | + WELS_VERIFY_RETURN_PROC_IF (cmInitParaError, WelsInitDecoder (m_pDecContext, &m_pWelsTrace->m_sLogCtx), UninitDecoder()) | |
| 268 | + | |
| 265 | 269 | return cmResultSuccess; |
| 266 | 270 | } |
| 267 | 271 | |
| @@ -291,7 +295,7 @@ long CWelsDecoder::SetOption (DECODER_OPTION eOptID, void* pOption) { · 23 unmodified lines | ||
| 291 | 295 | return dsInitialOptExpected; |
| 292 | 296 | |
| 293 | 297 | if (eOptID == DECODER_OPTION_DATAFORMAT) { // Set color space of decoding output frame |
| 294 | − if (m_pDecContext->bParseOnly) { | |
| 298 | + if (m_pDecContext->pParam->bParseOnly) { | |
| 295 | 299 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING, |
| 296 | 300 | "CWelsDecoder::SetOption for data format meaningless for parseonly."); |
| 297 | 301 | return cmResultSuccess; |
| @@ -318,7 +322,7 @@ long CWelsDecoder::SetOption (DECODER_OPTION eOptID, void* pOption) { · 20 unmodified lines | ||
| 318 | 322 | iVal = * ((int*)pOption); // int value for error concealment idc |
| 319 | 323 | iVal = WELS_CLIP3 (iVal, (int32_t) ERROR_CON_DISABLE, (int32_t) ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE); |
| 320 | 324 | m_pDecContext->pParam->eEcActiveIdc = m_pDecContext->eErrorConMethod = (ERROR_CON_IDC) iVal; |
| 321 | − if ((m_pDecContext->bParseOnly) && (m_pDecContext->eErrorConMethod != ERROR_CON_DISABLE)) { | |
| 325 | + if ((m_pDecContext->pParam->bParseOnly) && (m_pDecContext->eErrorConMethod != ERROR_CON_DISABLE)) { | |
| 322 | 326 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 323 | 327 | "CWelsDecoder::SetOption for ERROR_CON_IDC = %d not allowd for parse only!.", iVal); |
| 324 | 328 | return cmInitParaError; |