Changes to fix multiple thread start.

This commit is contained in:
Robert Osfield
2004-07-27 10:23:11 +00:00
parent bb5576bef8
commit 2e524ed9d7
3 changed files with 7 additions and 5 deletions

View File

@@ -60,9 +60,6 @@ QuicktimeImageStream::QuicktimeImageStream(std::string fileName) : ImageStream()
if (!fileName.empty())
setFileName(fileName);
startThread();
start();
}

View File

@@ -51,7 +51,12 @@ namespace osg {
virtual const char* className() const { return "QuicktimeImageStream"; }
/// Start or continue stream.
virtual void play() { setCmd(THREAD_START); }
virtual void play()
{
if (!isRunning()) start();
setCmd(THREAD_START);
}
/// Pause stream at current position.
virtual void pause() { setCmd(THREAD_STOP); }

View File

@@ -70,7 +70,7 @@ class ReaderWriterQT : public osgDB::ReaderWriter
// state on the ImageStream... will integrated as is right now
// to get things off the ground.
osg::QuicktimeImageStream* moov = new osg::QuicktimeImageStream(fileName);
moov->start();
moov->play();
return moov;
}