Throw a runtime error when a bad audio device is selected, so that the GUI can process the error message.

refer to #2165
This commit is contained in:
mark 2007-02-07 16:38:46 +00:00
parent b65810adfd
commit 3db4168db1
1 changed files with 5 additions and 2 deletions

View File

@ -143,11 +143,14 @@ GstreamerPlayer :: errorHandler(GstElement * pipeline,
gpointer self)
throw ()
{
std::cerr << "gstreamer error: " << error->message << std::endl;
// Important: We *must* use an idle function call here, so that the signal handler returns
// before fireOnStopEvent() is executed.
g_idle_add(fireOnStopEvent, self);
std::string str( "Audio Player Error: ");
str += error->message;
throw std::runtime_error(str);
}