Close audio if an error occurs while announcing the opened audio as the program is probably in an inconsistent state

Originally committed to SVN as r5946.
This commit is contained in:
Thomas Goyne 2011-11-30 04:28:03 +00:00
parent b4d2bba7a2
commit f0e98151f1

View file

@ -331,8 +331,16 @@ void AudioController::OpenAudio(const wxString &url)
video_position_marker_provider->AddMarkerMovedListener(std::tr1::bind(std::tr1::ref(AnnounceMarkerMoved)));
}
// Tell listeners about this.
AnnounceAudioOpen(provider);
try
{
// Tell listeners about this.
AnnounceAudioOpen(provider);
}
catch (...)
{
CloseAudio();
throw;
}
}