History

add dec status for freezing

huili2 committed 11 years ago

Commit 504cabf1 parent 82b70b38 files · +116 −43Browse files

Showing the changes to codec/decoder/plus/src/welsDecoderExt.cpp (1 of 8 files). Show all

Unified · Split

codec/decoder/plus/src/welsDecoderExt.cpp+13−4
@@ -373,8 +373,9 @@ long CWelsDecoder::GetOption (DECODER_OPTION eOptID, void* pOption) { · 372 unmodified lines
373373
374374 pDecoderStatistics->fAverageFrameSpeedInMs = (float) (m_pDecContext->dDecTime) /
375375 (m_pDecContext->sDecoderStatistics.uiDecodedFrameCount);
376− memset (&m_pDecContext->sDecoderStatistics, 0, sizeof (SDecoderStatistics));
376+ ResetDecStatNums (&m_pDecContext->sDecoderStatistics);
377377 m_pDecContext->dDecTime = 0;
378+
378379 return cmResultSuccess;
379380 }
380381
@@ -478,6 +479,10 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 97 unmodified lines
478479
479480 }
480481 m_pDecContext->sDecoderStatistics.uiDecodedFrameCount++;
482+ if (m_pDecContext->sDecoderStatistics.uiDecodedFrameCount == 0) { //exceed max value of uint32_t
483+ ResetDecStatNums (&m_pDecContext->sDecoderStatistics);
484+ m_pDecContext->sDecoderStatistics.uiDecodedFrameCount++;
485+ }
481486 m_pDecContext->sDecoderStatistics.uiEcFrameNum++;
482487 m_pDecContext->sDecoderStatistics.uiAvgEcRatio = m_pDecContext->sDecoderStatistics.uiAvgEcRatio /
483488 m_pDecContext->sDecoderStatistics.uiEcFrameNum;
@@ -490,14 +495,18 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 6 unmodified lines
490495
491496 if (pDstInfo->iBufferStatus == 1) {
492497
498+ m_pDecContext->sDecoderStatistics.uiDecodedFrameCount++;
499+ if (m_pDecContext->sDecoderStatistics.uiDecodedFrameCount == 0) { //exceed max value of uint32_t
500+ ResetDecStatNums (&m_pDecContext->sDecoderStatistics);
501+ m_pDecContext->sDecoderStatistics.uiDecodedFrameCount++;
502+ }
503+
493504 if ((m_pDecContext->sDecoderStatistics.uiWidth != (unsigned int) pDstInfo->UsrData.sSystemBuffer.iWidth)
494505 || (m_pDecContext->sDecoderStatistics.uiHeight != (unsigned int) pDstInfo->UsrData.sSystemBuffer.iHeight)) {
495506 m_pDecContext->sDecoderStatistics.uiResolutionChangeTimes++;
496507 m_pDecContext->sDecoderStatistics.uiWidth = pDstInfo->UsrData.sSystemBuffer.iWidth;
497508 m_pDecContext->sDecoderStatistics.uiHeight = pDstInfo->UsrData.sSystemBuffer.iHeight;
498−
499509 }
500− m_pDecContext->sDecoderStatistics.uiDecodedFrameCount++;
501510 }
502511 iEnd = WelsTime();
503512 m_pDecContext->dDecTime += (iEnd - iStart) / 1e3;
@@ -529,7 +538,7 @@ DECODING_STATE CWelsDecoder::DecodeParser (const unsigned char* kpSrc, · 25 unmodified lines
529538 m_pDecContext->pParserBsInfo = pDstInfo;
530539 pDstInfo->iNalNum = 0;
531540 pDstInfo->iSpsWidthInPixel = pDstInfo->iSpsHeightInPixel = 0;
532− if(pDstInfo) {
541+ if (pDstInfo) {
533542 m_pDecContext->uiTimeStamp = pDstInfo->uiInBsTimeStamp;
534543 pDstInfo->uiOutBsTimeStamp = 0;
535544 } else {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t