shithub: openh264

Download patch

ref: 2f0b6c8f14acbe6c9f60a5867f6fbd52734c3063
parent: 78ab4000c086c07d6841365541fd86d12ca98e4d
parent: 4d913096a150691cea0a4d5305d30bb31a534494
author: HaiboZhu <[email protected]>
date: Mon Apr 13 06:24:19 EDT 2015

Merge pull request #1893 from huili2/bugfix_nodelayAPI

bug fix for nodelay API for buffer storage

--- a/codec/decoder/plus/src/welsDecoderExt.cpp
+++ b/codec/decoder/plus/src/welsDecoderExt.cpp
@@ -400,11 +400,19 @@
     SBufferInfo* pDstInfo) {
   int iRet;
   SBufferInfo sTmpBufferInfo;
+  unsigned char* ppTmpDst[3] = {NULL, NULL, NULL};
+
   iRet = (int) DecodeFrame2 (kpSrc, kiSrcLen, ppDst, pDstInfo);
   memcpy (&sTmpBufferInfo, pDstInfo, sizeof (SBufferInfo));
+  ppTmpDst[0] = ppDst[0];
+  ppTmpDst[1] = ppDst[1];
+  ppTmpDst[2] = ppDst[2];
   iRet |= DecodeFrame2 (NULL, 0, ppDst, pDstInfo);
   if ((pDstInfo->iBufferStatus == 0) && (sTmpBufferInfo.iBufferStatus == 1)) {
     memcpy (pDstInfo, &sTmpBufferInfo, sizeof (SBufferInfo));
+    ppDst[0] = ppTmpDst[0];
+    ppDst[1] = ppTmpDst[1];
+    ppDst[2] = ppTmpDst[2];
   }
 
   return (DECODING_STATE) iRet;