Also similarly simplify the use of the return value from WelsStrftime and GetCodeName/GetLibName/GetVerNum.
Showing the changes to codec/decoder/plus/src (1 of 3 files). Show all
Unified · Split
| @@ -110,20 +110,16 @@ CWelsDecoder::CWelsDecoder (void) · 109 unmodified lines | |||
| 110 | iCurUsed = WelsSnprintf (chFileName, iBufLeft, "bs_0x%p_", (void*)this); | 110 | iCurUsed = WelsSnprintf (chFileName, iBufLeft, "bs_0x%p_", (void*)this); |
| 111 | iCurUsedSize = WelsSnprintf (chFileNameSize, iBufLeftSize, "size_0x%p_", (void*)this); | 111 | iCurUsedSize = WelsSnprintf (chFileNameSize, iBufLeftSize, "size_0x%p_", (void*)this); |
| 112 | 112 | ||
| 113 | if (iCurUsed > 0) { | 113 | iBufUsed += iCurUsed; |
| 114 | iBufUsed += iCurUsed; | 114 | iBufLeft -= iCurUsed; |
| 115 | iBufLeft -= iCurUsed; | ||
| 116 | } | ||
| 117 | if (iBufLeft > 0) { | 115 | if (iBufLeft > 0) { |
| 118 | iCurUsed = WelsStrftime (&chFileName[iBufUsed], iBufLeft, "%y%m%d%H%M%S", &sCurTime); | 116 | iCurUsed = WelsStrftime (&chFileName[iBufUsed], iBufLeft, "%y%m%d%H%M%S", &sCurTime); |
| 119 | iBufUsed += iCurUsed; | 117 | iBufUsed += iCurUsed; |
| 120 | iBufLeft -= iCurUsed; | 118 | iBufLeft -= iCurUsed; |
| 121 | } | 119 | } |
| 122 | 120 | ||
| 123 | if (iCurUsedSize > 0) { | 121 | iBufUsedSize += iCurUsedSize; |
| 124 | iBufUsedSize += iCurUsedSize; | 122 | iBufLeftSize -= iCurUsedSize; |
| 125 | iBufLeftSize -= iCurUsedSize; | ||
| 126 | } | ||
| 127 | if (iBufLeftSize > 0) { | 123 | if (iBufLeftSize > 0) { |
| 128 | iCurUsedSize = WelsStrftime (&chFileNameSize[iBufUsedSize], iBufLeftSize, "%y%m%d%H%M%S", &sCurTime); | 124 | iCurUsedSize = WelsStrftime (&chFileNameSize[iBufUsedSize], iBufLeftSize, "%y%m%d%H%M%S", &sCurTime); |
| 129 | iBufUsedSize += iCurUsedSize; | 125 | iBufUsedSize += iCurUsedSize; |
| @@ -132,19 +128,15 @@ CWelsDecoder::CWelsDecoder (void) · 2 unmodified lines | |||
| 132 | 128 | ||
| 133 | if (iBufLeft > 0) { | 129 | if (iBufLeft > 0) { |
| 134 | iCurUsed = WelsSnprintf (&chFileName[iBufUsed], iBufLeft, ".%03.3u.264", WelsGetMillisecond (&sCurTime)); | 130 | iCurUsed = WelsSnprintf (&chFileName[iBufUsed], iBufLeft, ".%03.3u.264", WelsGetMillisecond (&sCurTime)); |
| 135 | if (iCurUsed > 0) { | 131 | iBufUsed += iCurUsed; |
| 136 | iBufUsed += iCurUsed; | 132 | iBufLeft -= iCurUsed; |
| 137 | iBufLeft -= iCurUsed; | ||
| 138 | } | ||
| 139 | } | 133 | } |
| 140 | 134 | ||
| 141 | if (iBufLeftSize > 0) { | 135 | if (iBufLeftSize > 0) { |
| 142 | iCurUsedSize = WelsSnprintf (&chFileNameSize[iBufUsedSize], iBufLeftSize, ".%03.3u.len", | 136 | iCurUsedSize = WelsSnprintf (&chFileNameSize[iBufUsedSize], iBufLeftSize, ".%03.3u.len", |
| 143 | WelsGetMillisecond (&sCurTime)); | 137 | WelsGetMillisecond (&sCurTime)); |
| 144 | if (iCurUsedSize > 0) { | 138 | iBufUsedSize += iCurUsedSize; |
| 145 | iBufUsedSize += iCurUsedSize; | 139 | iBufLeftSize -= iCurUsedSize; |
| 146 | iBufLeftSize -= iCurUsedSize; | ||
| 147 | } | ||
| 148 | } | 140 | } |
| 149 | 141 | ||
| 150 | 142 | ||