Changeset 9914

Show
Ignore:
Timestamp:
03/11/09 19:13:58 (6 years ago)
Author:
robert
Message:

Changed audio playing so that it only happens for a single movie to avoid
problems with audio stalling.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgmovie/osgmovie.cpp

    r9913 r9914  
    500500    bool useAudioSink = false; 
    501501    while(arguments.read("--audio")) { useAudioSink = true; } 
     502     
     503    unsigned int numAudioStreamsEnabled = 0; 
    502504 
    503505    for(int i=1;i<arguments.argc();++i) 
     
    515517                    osg::notify(osg::NOTICE)<<"AudioStream read ["<<audioStream->getName()<<"]"<<std::endl; 
    516518#if USE_SDL 
    517                     audioStream->setAudioSink(new SDLAudioSink(audioStream)); 
     519 
     520                    if (numAudioStreamsEnabled==0) 
     521                    { 
     522                        audioStream->setAudioSink(new SDLAudioSink(audioStream)); 
     523                         
     524                        ++numAudioStreamsEnabled; 
     525                    } 
    518526#endif 
    519527                }