| 258 | } |
| 259 | |
| 260 | void FFMS_AudioSource::ResampleAndCache(CacheIterator pos) { |
| 261 | AudioBlock& block = *pos; |
| 262 | |
| 263 | size_t size = DecodeFrame->nb_samples * BytesPerSample; |
| 264 | auto dst = block.Grow(size); |
| 265 | |
| 266 | uint8_t *OutPlanes[1] = { dst }; |
| 267 | |
| 268 | swr_convert(ResampleContext.get(), OutPlanes, DecodeFrame->nb_samples, (const uint8_t **)DecodeFrame->extended_data, DecodeFrame->nb_samples); |
| 269 | } |
| 270 | |
| 271 | FFMS_AudioSource::AudioBlock *FFMS_AudioSource::CacheBlock(CacheIterator &pos) { |
| 272 | // If the previous block has the same Start sample as this one, then |