Split GetPointer into two versions, to help with const correctness

This commit is contained in:
Henrik Rydgård
2022-07-20 12:40:22 +02:00
parent d2a3918f5f
commit e6403d7157
43 changed files with 169 additions and 156 deletions
+3 -3
View File
@@ -177,7 +177,7 @@ bool SimpleAudio::IsOK() const {
#endif
}
bool SimpleAudio::Decode(void *inbuf, int inbytes, uint8_t *outbuf, int *outbytes) {
bool SimpleAudio::Decode(const uint8_t *inbuf, int inbytes, uint8_t *outbuf, int *outbytes) {
#ifdef USE_FFMPEG
if (!codecOpen_) {
OpenCodec(inbytes);
@@ -185,7 +185,7 @@ bool SimpleAudio::Decode(void *inbuf, int inbytes, uint8_t *outbuf, int *outbyte
AVPacket packet;
av_init_packet(&packet);
packet.data = static_cast<uint8_t *>(inbuf);
packet.data = (uint8_t *)(inbuf);
packet.size = inbytes;
int got_frame = 0;
@@ -338,7 +338,7 @@ size_t AuCtx::FindNextMp3Sync() {
// return output pcm size, <0 error
u32 AuCtx::AuDecode(u32 pcmAddr) {
u32 outptr = PCMBuf + nextOutputHalf * PCMBufSize / 2;
auto outbuf = Memory::GetPointer(outptr);
auto outbuf = Memory::GetPointerWrite(outptr);
int outpcmbufsize = 0;
if (pcmAddr)