| 258 | } |
| 259 | |
| 260 | void DestroyPicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, CMemoryAlign* pMa) { |
| 261 | PPicBuff pPicBuf = NULL; |
| 262 | |
| 263 | ResetReorderingPictureBuffers (pCtx->pPictReoderingStatus, pCtx->pPictInfoList, false); |
| 264 | |
| 265 | if (NULL == ppPicBuf || NULL == *ppPicBuf) |
| 266 | return; |
| 267 | |
| 268 | pPicBuf = *ppPicBuf; |
| 269 | while (pPicBuf->ppPic != NULL) { |
| 270 | int32_t iPicIdx = 0; |
| 271 | while (iPicIdx < pPicBuf->iCapacity) { |
| 272 | PPicture pPic = pPicBuf->ppPic[iPicIdx]; |
| 273 | if (pPic != NULL) { |
| 274 | FreePicture (pPic, pMa); |
| 275 | } |
| 276 | pPic = NULL; |
| 277 | ++ iPicIdx; |
| 278 | } |
| 279 | |
| 280 | pMa->WelsFree (pPicBuf->ppPic, "pPicBuf->queue"); |
| 281 | |
| 282 | pPicBuf->ppPic = NULL; |
| 283 | } |
| 284 | pPicBuf->iCapacity = 0; |
| 285 | pPicBuf->iCurrentIdx = 0; |
| 286 | |
| 287 | pMa->WelsFree (pPicBuf, "pPicBuf"); |
| 288 | |
| 289 | pPicBuf = NULL; |
| 290 | *ppPicBuf = NULL; |
| 291 | } |
| 292 | |
| 293 | //reset picture reodering buffer list |
| 294 | void ResetReorderingPictureBuffers (PPictReoderingStatus pPictReoderingStatus, PPictInfo pPictInfo, |
no test coverage detected