From effcac6ee0bc2297eed8f00e0b04f78064090dd6 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 17 Nov 2012 23:30:14 +0200 Subject: [PATCH] Fix compilation with recent gcc --- source/sound.cpp | 2 +- source/streamer.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/sound.cpp b/source/sound.cpp index f43948e..c4a00ef 100644 --- a/source/sound.cpp +++ b/source/sound.cpp @@ -18,7 +18,7 @@ struct MemorySource size_t memory_read(void *ptr, size_t size, size_t nmemb, void *src) { MemorySource &memsrc = *reinterpret_cast(src); - unsigned len = min(size*nmemb, memsrc.length-memsrc.pos); + unsigned len = min(size*nmemb, memsrc.length-memsrc.pos); memcpy(ptr, reinterpret_cast(memsrc.data)+memsrc.pos, len); memsrc.pos += len; diff --git a/source/streamer.cpp b/source/streamer.cpp index 2c2619b..b90a9d1 100644 --- a/source/streamer.cpp +++ b/source/streamer.cpp @@ -54,13 +54,13 @@ void Streamer::tick() unsigned freq = snd->get_frequency(); unsigned chunk_size = freq&~0xF; unsigned queued = src.get_buffers_queued(); + vector data(chunk_size); for(unsigned i=queued; i<4; ++i) { - char data[chunk_size]; unsigned pos = 0; while(posread(data+pos, chunk_size-pos); + unsigned len = snd->read(&data[0]+pos, chunk_size-pos); if(len==0) break; pos += len; @@ -69,7 +69,7 @@ void Streamer::tick() if(pos) { Buffer *buf = new Buffer; - buf->data(snd->get_format(), data, pos, freq); + buf->data(snd->get_format(), &data[0], pos, freq); src.queue_buffer(*buf); buffers.push_back(buf); } -- 2.45.2