ref: 9cf9238cfc784e829e81f9cad1f044511bd3bd37
parent: a18cb49cd83fac5dd2017bfaf6369e77198676b8
author: ruil2 <[email protected]>
date: Tue Mar 18 13:38:48 EDT 2014
fix bug that there is no output in encoder console
--- a/codec/console/enc/src/welsenc.cpp
+++ b/codec/console/enc/src/welsenc.cpp
@@ -761,13 +761,13 @@
iStart = WelsTime();
long iEncode = pPtrEnc->EncodeFrame (pSrcPic, &sFbi);
iTotal += WelsTime() - iStart;
- if (videoFrameTypeInvalid == iEncode) {
+ if (cmResultSuccess != iEncode) {
fprintf (stderr, "EncodeFrame() failed: %ld.\n", iEncode);
break;
}
/* Write bit-stream */
- if (pFpBs != NULL && videoFrameTypeSkip != iEncode) { // file handler to write bit stream
+ if (pFpBs != NULL && videoFrameTypeSkip != sFbi.eOutputFrameType) { // file handler to write bit stream
int iLayer = 0;
while (iLayer < sFbi.iLayerNum) {
SLayerBSInfo* pLayerBsInfo = &sFbi.sLayerInfo[iLayer];
@@ -981,11 +981,11 @@
iTotal += WelsTime() - iStart;
// fixed issue in case dismatch source picture introduced by frame skipped, 1/12/2010
- if (videoFrameTypeSkip == iEncFrames) {
+ if (videoFrameTypeSkip == sFbi.eOutputFrameType) {
continue;
}
- if (iEncFrames != videoFrameTypeInvalid && iEncFrames != videoFrameTypeSkip) {
+ if (iEncFrames == cmResultSuccess) {
int iLayer = 0;
int iFrameSize = 0;
while (iLayer < sFbi.iLayerNum) {
--- a/codec/encoder/plus/src/welsEncoderExt.cpp
+++ b/codec/encoder/plus/src/welsEncoderExt.cpp
@@ -581,7 +581,7 @@
default:
break;
}
-
+ pBsInfo->eOutputFrameType = iFrameType;
///////////////////for test
#ifdef OUTPUT_BIT_STREAM
if (iFrameType != videoFrameTypeInvalid && iFrameType != videoFrameTypeSkip) {