From b707be21d2a4b15f28f4053727ce02cfea3e6476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Wed, 25 Aug 2010 09:09:18 +0000 Subject: [PATCH] Fixed copy'n'paste bug: _FindDecoder returned B_ERROR went it was supposed to return false. This happened when searching decoders in /boot/common/add-ons/media/plugins, which does not exist on a default image and thus broke finding *any* decoder, it only worked when you had some in /boot/home/config/add-ons/media/plugins... sorry and thanks Alex Wilson for the heads up! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38347 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/media/AddOnManager.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/servers/media/AddOnManager.cpp b/src/servers/media/AddOnManager.cpp index 757c33bcba..d430a50b51 100644 --- a/src/servers/media/AddOnManager.cpp +++ b/src/servers/media/AddOnManager.cpp @@ -126,11 +126,14 @@ AddOnManager::GetDecoderForFormat(xfer_entry_ref* _decoderRef, BPath path; for (uint i = 0; i < sizeof(sDirectories) / sizeof(directory_which); i++) { - if (find_directory(sDirectories[i], &path) == B_OK - && path.Append("media/plugins") == B_OK) { - if (_FindDecoder(format, path, _decoderRef)) - return B_OK; + if (find_directory(sDirectories[i], &path) != B_OK + || path.Append("media/plugins") != B_OK) { + printf("AddOnManager::GetDecoderForFormat: failed to construct " + "path for directory %u\n", i); + continue; } + if (_FindDecoder(format, path, _decoderRef)) + return B_OK; } return B_ENTRY_NOT_FOUND; @@ -574,7 +577,9 @@ AddOnManager::_FindDecoder(const media_format& format, const BPath& path, BDirectory directory; if (directory.SetTo(path.Path()) != B_OK || directory.GetNodeRef(&nref) != B_OK) { - return B_ERROR; + printf("AddOnManager::_FindDecoder() - failed to init BDirectory " + "for %s\n", path.Path()); + return false; } decoder_info* info;