jackdbus: don't print error during normal flow

Even if client is subscribed to jack server start/stop signals,
there is a timeframe between jack server stop and signal delivery.
In this frame, calls that require started server will fail.
This is part of normal operation and should not be treated as real error.
With this changeset, error is reported through dbus but no error is printed
in the log file

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3843 0c269be4-1314-0410-8aa9-9f06e86f4224
This commit is contained in:
nedko 2009-12-06 19:00:17 +00:00
parent 9d519b5064
commit 6aebfde97d
3 changed files with 40 additions and 2 deletions

View File

@ -283,8 +283,11 @@ jack_control_run_method(
return true;
not_started:
jack_dbus_error (call, JACK_DBUS_ERROR_SERVER_NOT_RUNNING,
"Can't execute method '%s' with stopped JACK server", call->method_name);
jack_dbus_only_error(
call,
JACK_DBUS_ERROR_SERVER_NOT_RUNNING,
"Can't execute method '%s' with stopped JACK server",
call->method_name);
exit:
return true;

View File

@ -765,6 +765,34 @@ jack_dbus_error(
va_end(ap);
}
void
jack_dbus_only_error(
void *dbus_call_context_ptr,
const char *error_name,
const char *format,
...)
{
va_list ap;
char buffer[300];
va_start(ap, format);
vsnprintf(buffer, sizeof(buffer), format, ap);
if (((struct jack_dbus_method_call *)dbus_call_context_ptr)->reply != NULL)
{
dbus_message_unref(((struct jack_dbus_method_call *)dbus_call_context_ptr)->reply);
((struct jack_dbus_method_call *)dbus_call_context_ptr)->reply = NULL;
}
((struct jack_dbus_method_call *)dbus_call_context_ptr)->reply = dbus_message_new_error(
((struct jack_dbus_method_call *)dbus_call_context_ptr)->message,
error_name,
buffer);
va_end(ap);
}
int
main (int argc, char **argv)
{

View File

@ -257,6 +257,13 @@ jack_dbus_error(
const char *format,
...);
void
jack_dbus_only_error(
void *dbus_call_context_ptr,
const char *error_name,
const char *format,
...);
bool
jack_dbus_get_method_args(
struct jack_dbus_method_call *call,