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

MediaController calls stop() after Channel already disposed #97

Open
i8beef opened this issue Jul 12, 2020 · 0 comments
Open

MediaController calls stop() after Channel already disposed #97

i8beef opened this issue Jul 12, 2020 · 0 comments

Comments

@i8beef
Copy link

i8beef commented Jul 12, 2020

The MediaController attaches an "onclose" to its own "close" event which will send a session command of STOP through the underlying channel.

However, the MediaController only EMITS a "close" event from its inherited Controller, in response to the Channel having already closed. This will ALWAYS ERROR if the Channel is disposed, and is only missed now because of #96 failing to properly close the channel anyway.

Suggestion: Just remove the "self.stop()" call here. If the channel is already dead, you've already lost your opportunity.

Adding a Controller.close override to the MediaController would allow you to call this stop prior to calling the underlying Controller "close" to run this "STOP" before the channel goes away, but I actually think this would be poor form. It would probably cause issues with multiple instances of DefaultMediaReceiver that share a Client connection from coexisting given that any ONE of them closing would then trigger a media STOP rather than requiring a conscious decision from the calling code to do this prior to the receiver.close: i.e., it removes options rather than doing necessary cleanup.

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

No branches or pull requests

1 participant