X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fstreamer.cpp;h=8fe7483cc735ffbc5fab4dfa3c8185b35fc5044d;hb=bb3f1a84f09963031a88175c4f44c872d508447b;hp=36545f67cab004c63b73cb27145ececa4c27fe04;hpb=58dc1e7c15f928d0f861a20c46f2be4112bf5baf;p=libs%2Fal.git diff --git a/source/streamer.cpp b/source/streamer.cpp index 36545f6..8fe7483 100644 --- a/source/streamer.cpp +++ b/source/streamer.cpp @@ -1,7 +1,7 @@ /* $Id$ This file is part of libmspal -Copyright © 2008 Mikko Rasa, Mikkosoft Productions +Copyright © 2008-2009 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ @@ -55,6 +55,9 @@ void Streamer::tick() if(!snd) return; + if(src.get_state()!=PLAYING && src.get_state()!=PAUSED) + src.play(); + unsigned freq=snd->get_frequency(); unsigned chunk_size=freq&~0xF; unsigned queued=src.get_buffers_queued(); @@ -78,6 +81,9 @@ void Streamer::tick() buffers.push_back(buf); } } + + if(snd->eof()) + snd=0; } } // namespace AL