- Timestamp:
- Apr 17, 2006, 12:07:57 AM (19 years ago)
- Location:
- trunk/src/lib/sound
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/sound/ogg_player.cc
r7309 r7310 69 69 bool OggPlayer::open(const std::string& fileName) 70 70 { 71 MutexLock(this->musicMutex); 71 72 // release old Ogg-File (if loaded) 72 73 if (this->state & OggPlayer::FileOpened) … … 300 301 { 301 302 assert (!(this->state & Playing)); 302 this->printState();303 303 SDL_WaitThread(this->musicThreadID, NULL); 304 304 this->musicThreadID = NULL; … … 389 389 if (this->state & OggPlayer::Playing); 390 390 { 391 // Kill the Music Thread. 391 392 this->state &= ~OggPlayer::Playing; 392 // Kill the Music Thread. 393 if (this->musicThreadID != NULL) 394 this->suspend(); 393 this->suspend(); 395 394 396 395 SoundEngine::checkError("OggPlayer::release()::alSourceStop", __LINE__); -
trunk/src/lib/sound/ogg_player.h
r7309 r7310 89 89 SDL_Thread* musicThreadID; //!< The Thread in which music is Played back. 90 90 SDL_mutex* musicMutex; //!< A Mutex so that the two threads do not interfere. 91 92 class MutexLock 93 { 94 public: 95 MutexLock(SDL_mutex* mutex) { SDL_mutexP(mutex); this->mutex = mutex; }; 96 ~MutexLock() { SDL_mutexV(mutex); }; 97 private: 98 SDL_mutex* mutex; 99 }; 91 100 }; 92 101
Note: See TracChangeset
for help on using the changeset viewer.