Fixed deadlock after 2 songs (closes #32).

This commit is contained in:
bjorn.olievier 2008-04-24 19:10:16 +00:00
parent dcefa4afb1
commit 9ac32bd415
5 changed files with 15 additions and 7 deletions

View File

@ -88,12 +88,6 @@ void Transport::Start(const utfstring path)
if (success)
{
this->PlaybackStartedOk();
// Stop currently playing song if any
if (this->openStreams.size() > 1)
{
this->Stop(0);
}
}
else
{

View File

@ -266,3 +266,9 @@ void ConsoleUI::ShutDown()
delete instance;
return 0;
}
void ConsoleUI::StartNew()
{
Args a;
this->PlayFile(a);
}

View File

@ -82,6 +82,8 @@ private: boost::mutex mutex;
private: void ShutDown();
public: static DWORD WINAPI ThreadRun(LPVOID param);
public: void StartNew();
};
}} // NS

View File

@ -51,4 +51,10 @@ DummyAudioEventHandler::~DummyAudioEventHandler()
void DummyAudioEventHandler::PrintEvent(utfstring s)
{
this->cui->Print(_T("EVENT: " + s + _T("\n")));
}
void DummyAudioEventHandler::OnMixpointReached()
{
this->PrintEvent(_T("Mix point reached"));
//this->cui->StartNew(); // Endless test loop
}

View File

@ -63,7 +63,7 @@ public: void OnVolumeChangedOk() { this->PrintEvent(_T("Volume chan
public: void OnVolumeChangedFail() { this->PrintEvent(_T("Volume changed FAIL")); };
public: void OnStreamOpenOk() { this->PrintEvent(_T("Stream open OK")); };
public: void OnStreamOpenFail() { this->PrintEvent(_T("Stream open FAIL")); };
public: void OnMixpointReached() { this->PrintEvent(_T("Mix point reached")); };
public: void OnMixpointReached() ;
public: void OnSetPositionOk() { this->PrintEvent(_T("Set position OK")); };
public: void OnSetPositionFail() { this->PrintEvent(_T("Set position FAIL")); };
};