IPlayItem item = SimplePlayItem.build(streamName);
int itemCount = playlistStream.getItemSize();
for (int i = 0; i < itemCount; i++) {
IPlayItem tmpItem = playlistStream.getItem(i);
if (tmpItem.getName().equals(oldStreamName)) {
if (!playlistStream.replace(tmpItem, item)) {
log.warn("Playlist item replacement failed");
sendNSFailed(streamConn, StatusCodes.NS_PLAY_FAILED, "Playlist swap failed.", streamName, streamId);
}
break;
}