Skip to content
This repository was archived by the owner on Jan 10, 2024. It is now read-only.

Conversation

tresf
Copy link
Contributor

@tresf tresf commented Nov 9, 2017

First, thanks for the plugins! And second, hi from LMMS!

We've been bundling the tap-plugins for quite some time but we've been pretty bad about sending our patches back.

We have an initiative to move all of our plugin code back to the upstream maintainers, so that this won't happen anymore. :) I hope this PR is well received.

The changes are pretty small, so I've placed them all into one commit.

I did not author these changes, however they are needed (especially the constructors/destructors) to use an upstream source mirror. We support several build systems including Linux, BSD, Apple and Windows (gcc and clang for now), so patches are driven primary by 1. Making them work and 2. Compiler warnings. Reviewing the changes, I can observe one that appears to be a styling change as well. I hope this is OK. I can move that to a separate PR if needed.

The downstream documented fixes that we have are (should jump to relevant snippet):

  1. Fix compiler warnings: LMMS/lmms@52d4f0f#diff-4e4adf4e4277f5cc6565de9d9b200bb4
  2. Don't mis-initialize rand with default value: LMMS/lmms@5701598#diff-11fbde16f5d448c9161be2e1017296a4
  3. Misc code cleanup: LMMS/lmms@2049e00#diff-769b5878579023b42826f5addfba09bc
  4. Fix instantiation/destruction: LMMS/lmms@83c2019#diff-41c1bb33908f8e8f520fb7b1b0b5958b
  5. Fix memory leak: LMMS/lmms@ddbb180#diff-602c24fe9eeb819fedb642682d941b5b

Any changes needed, please let me know. I'd also be willing to split commits and/or PRs if that makes it easier.

Copy link
Owner

@tomscii tomscii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would love to merge this, but please address my comment/question below

tap_pinknoise.c Outdated
@@ -236,9 +236,6 @@ _init() {
(LADSPA_Descriptor *)malloc(sizeof(LADSPA_Descriptor))) == NULL)
exit(1);

/* initialize RNG */
srand(time(0));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's wrong with this, and how is the RNG supposed to be initialized without it?

Copy link
Contributor Author

@tresf tresf Nov 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tomszilagyi you're completely correct, this should not be removed from the plugin. It appears these lines conflict with the use of srand() in the parent application and allowing them to be called here has an adverse affect on the parent. Would you be ok with us adding some pre-compiler flags to allow us to turn this off for a use-case that has already called srand() prior to loading the plugin?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that would be a reasonably good way to handle it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Proposed via b3978dc, downstream logic proposed here tresf/lmms@c444760.

@tomscii tomscii merged commit 198b84e into tomscii:master Nov 16, 2017
@tomscii
Copy link
Owner

tomscii commented Nov 16, 2017

Thanks for the fixes!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants