shithub: openh264

Download patch

ref: 2b59746c68ba3810154ef1ac4d8d9ce3a1b0246e
parent: bf33bde15defd14765cd00c5d0742338f0bd96bd
parent: 47d6ac3b5786f273c4bc9c49d38eac49dabb4022
author: HaiboZhu <haibozhu@cisco.com>
date: Wed Aug 19 06:30:30 EDT 2015

Merge pull request #2077 from shihuade/RDBugFixed_V2.0_01

bug-fixed----left length of destination buffer for writing slice bs

--- a/codec/encoder/core/src/slice_multi_threading.cpp
+++ b/codec/encoder/core/src/slice_multi_threading.cpp
@@ -764,7 +764,7 @@
         WelsUnloadNalForSlice (pSliceBs);
 
         int32_t iLeftBufferSize = (iSliceIdx > 0) ?
-                                  (pSliceBs->uiSize - (int32_t) (pSliceBs->sBsWrite.pCurBuf - pSliceBs->sBsWrite.pStartBuf))
+                                  (pSliceBs->uiSize - pSliceBs->uiBsPos)
                                   : (pEncPEncCtx->iFrameBsSize - pEncPEncCtx->iPosBsBuffer);
         iReturn = WriteSliceBs (pEncPEncCtx, pSliceBs->pBs,
                                 &pSliceBs->iNalLen[0],
@@ -883,7 +883,7 @@
             pEncPEncCtx->iPosBsBuffer += iSliceSize;
           } else {
             iReturn = WriteSliceBs (pEncPEncCtx, pSliceBs->pBs, &pSliceBs->iNalLen[0],
-                                    pSliceBs->uiSize - (int32_t) (pSliceBs->sBsWrite.pCurBuf - pSliceBs->sBsWrite.pStartBuf),
+                                    pSliceBs->uiSize - pSliceBs->uiBsPos,
                                     iSliceIdx, iSliceSize);
             if (ENC_RETURN_SUCCESS != iReturn) {
               uiThrdRet = iReturn;