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
This commit is contained in:
@@ -126,11 +126,14 @@ AddOnManager::GetDecoderForFormat(xfer_entry_ref* _decoderRef,
|
|||||||
|
|
||||||
BPath path;
|
BPath path;
|
||||||
for (uint i = 0; i < sizeof(sDirectories) / sizeof(directory_which); i++) {
|
for (uint i = 0; i < sizeof(sDirectories) / sizeof(directory_which); i++) {
|
||||||
if (find_directory(sDirectories[i], &path) == B_OK
|
if (find_directory(sDirectories[i], &path) != B_OK
|
||||||
&& path.Append("media/plugins") == B_OK) {
|
|| path.Append("media/plugins") != B_OK) {
|
||||||
if (_FindDecoder(format, path, _decoderRef))
|
printf("AddOnManager::GetDecoderForFormat: failed to construct "
|
||||||
return B_OK;
|
"path for directory %u\n", i);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
if (_FindDecoder(format, path, _decoderRef))
|
||||||
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
return B_ENTRY_NOT_FOUND;
|
return B_ENTRY_NOT_FOUND;
|
||||||
@@ -574,7 +577,9 @@ AddOnManager::_FindDecoder(const media_format& format, const BPath& path,
|
|||||||
BDirectory directory;
|
BDirectory directory;
|
||||||
if (directory.SetTo(path.Path()) != B_OK
|
if (directory.SetTo(path.Path()) != B_OK
|
||||||
|| directory.GetNodeRef(&nref) != 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;
|
decoder_info* info;
|
||||||
|
|||||||
Reference in New Issue
Block a user