Skip to content

Commit

Permalink
AddOnManager::GetStreamers: Consider maxCount and outCount
Browse files Browse the repository at this point in the history
* Fix a little issue when getting the plugin.
  • Loading branch information
Numerio committed May 16, 2016
1 parent dc94132 commit 21cf69c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/kits/media/AddOnManager.cpp
Expand Up @@ -210,12 +210,18 @@ AddOnManager::GetStreamers(entry_ref* outRefs, int32* outCount,
BAutolock locker(fLock);
RegisterAddOns();

int32 count = 0;
streamer_info* info;
for (fStreamerList.Rewind(); fStreamerList.GetNext(&info);) {
if (count == maxCount)
break;

*outRefs = info->ref;
outRefs++;
count++;
}

*outCount = count;
return B_OK;
}

Expand Down

0 comments on commit 21cf69c

Please sign in to comment.