| 96 | } |
| 97 | |
| 98 | void ReturnDecoder(DecInstance *decoder) { |
| 99 | std::unique_lock lock(access_lock); |
| 100 | auto range = dec_cache.equal_range(decoder->codec_type); |
| 101 | for (auto it = range.first; it != range.second; ++it) { |
| 102 | if (&it->second == decoder) { |
| 103 | it->second.used = false; |
| 104 | return; |
| 105 | } |
| 106 | } |
| 107 | DALI_FAIL("Cannot return decoder that is not from the cache"); |
| 108 | } |
| 109 | |
| 110 | private: |
| 111 | NVDECCache() {} |