From b66837d4cd675bf7b0dd517d58db94eedb4a3707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 19 Jul 2008 15:30:29 +0000 Subject: [PATCH] Better debug output, print the error string when failing to get a Reader or Decoder. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26504 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/media/PluginManager.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/kits/media/PluginManager.cpp b/src/kits/media/PluginManager.cpp index 4b483d320a..4332460fad 100644 --- a/src/kits/media/PluginManager.cpp +++ b/src/kits/media/PluginManager.cpp @@ -32,10 +32,12 @@ PluginManager::CreateReader(Reader **reader, int32 *streamCount, // get list of available readers from the server server_get_readers_request request; server_get_readers_reply reply; - if (QueryServer(SERVER_GET_READERS, &request, sizeof(request), - &reply, sizeof(reply)) != B_OK) { - printf("PluginManager::CreateReader: can't get list of readers\n"); - return B_ERROR; + status_t ret = QueryServer(SERVER_GET_READERS, &request, sizeof(request), + &reply, sizeof(reply)); + if (ret != B_OK) { + printf("PluginManager::CreateReader: can't get list of readers: %s\n", + strerror(ret)); + return ret; } // try each reader by calling it's Sniff function... @@ -98,10 +100,12 @@ PluginManager::CreateDecoder(Decoder **_decoder, const media_format &format) server_get_decoder_for_format_request request; server_get_decoder_for_format_reply reply; request.format = format; - if (B_OK != QueryServer(SERVER_GET_DECODER_FOR_FORMAT, &request, - sizeof(request), &reply, sizeof(reply))) { - TRACE("PluginManager::CreateDecoder: can't get decoder for format\n"); - return B_ERROR; + status_t ret = QueryServer(SERVER_GET_DECODER_FOR_FORMAT, &request, + sizeof(request), &reply, sizeof(reply)); + if (ret != B_OK) { + printf("PluginManager::CreateDecoder: can't get decoder for format: " + "%s\n", strerror(ret)); + return ret; } MediaPlugin *plugin = GetPlugin(reply.ref);