Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test with reset() behaves oddly #39

Open
wants to merge 34 commits into
base: master
Choose a base branch
from

Conversation

HelgeStenstrom
Copy link
Collaborator

reset() is a public method. If it's called when the player is playing, it seems to not return. I cannot really see what is executing when I run the test in the debugger.

The test print "play()", and goes on to play the song. It never prints "reset()"

Expected behavior: The player is stopped so quickly, that no music is heard. Maxium one frame of sound samples.
The word "reset() should be printed after "play()".

What can be learnt from this behavior?

Alphabetically sorted methods
reset() is a public method. If it's called when the player is playing, it seems to not return. I cannot really see what is executing when I run the test in the debugger.

The test print "play()", and goes on to play the song. It never prints "reset()"

Expected behavior: The player is stopped so quickly, that no music is heard. Maxium one frame of sound samples.
The word "reset() should be printed after "play()".

What can be learnt from this behavior?
@HelgeStenstrom
Copy link
Collaborator Author

This is more of a bug report than a real pull request. The PR has one test, and the test doesn't end quickly as tests should, so it's useless as a unit test. But it might be good for illustrating a problem.

@goxr3plus
Copy link
Owner

Reset never returns because (audiolock) is already locked by call method when the sound is playing, so it stuck on synchronized(audiolock) until the sound stops or pauses and the lock is getting free. One thing could be that reset internally calls stop first but actually we can make reset private if it's not needed.

HelgeStenstrom and others added 7 commits September 11, 2019 21:18
…treamPlayer

Extract class from stream player
reset() is a public method. If it's called when the player is playing, it seems to not return. I cannot really see what is executing when I run the test in the debugger.

The test print "play()", and goes on to play the song. It never prints "reset()"

Expected behavior: The player is stopped so quickly, that no music is heard. Maxium one frame of sound samples.
The word "reset() should be printed after "play()".

What can be learnt from this behavior?
@goxr3plus
Copy link
Owner

Should i merge this :)?

@HelgeStenstrom
Copy link
Collaborator Author

No, that wasn't the intention. It's more of documentation for the bug report.

@goxr3plus
Copy link
Owner

Good

@goxr3plus
Copy link
Owner

I need to redesign then

@goxr3plus goxr3plus marked this pull request as ready for review December 31, 2019 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants