From: Mikko Rasa Date: Sat, 17 Nov 2012 21:30:14 +0000 (+0200) Subject: Fix compilation with recent gcc X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=effcac6ee0bc2297eed8f00e0b04f78064090dd6;p=libs%2Fal.git Fix compilation with recent gcc --- 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); }