LibVLC: Stops functioning after repeated stream playback stop/starts
Description
When you have an application that is using LibVLC, which is alternating between different network streams that it can play back, it will suddenly stop being able to play back network streams on one of the media changes. When this occurs, the playback of any network streams in any applications utilising LibVLC will not work if you try to do so. The only fix is to restart the device. If you try to restart the app that has the issues (Like the sample app I have provided at the link below), it will not work, and will just sit there and do nothing.
As far as I can tell, this issue looks to be caused by a memory leak when changing media sources, as some devices that are running the full application I have made, that are just sitting on one network stream not changing do not crash like the ones that change source more often.
See further below for the link to the sample app I have written that can be used to demonstrate this in action.
Expected behaviour
When the media source is changed the player is looking at, the native memory would be correctly handled, so it does not reach a point where LibVLC on a device becomes non functional, in any applications installed on that device using LibVLC.
Actual behaviour
When the media source has been changed a number of times, it appears to reach a point where it runs out of memory(?) and LibVLC can no longer correctly function in any applications until the device is restarted.
Steps to reproduce
I have written a fully working, minimum basic example application, complete with documentation and configuration/usage structures, available here at this link: https://github.com/LRTNZ/test-vlc-application Just download, adjust the various required settings in the code as outlined in the documentation, and setup two multicast streams.
Start the app, and let it sit there running until it breaks. Then try and open it up, and see how it does not work. Also try open the VLC-Android application, and point it at one of the multicast streams. See how it does not work either. Reboot the device, see how the VLC-Android application works, and the test application begins working again
Screenshot / video
N/A
Context
App version
Latest version of the LibVLC code in the master branch, as of this point in time (2/04/2020)
Android version
Observed on Android TV 8 and 9, as that is what I have to hand
Device model
Many types of Sony Bravia TVs, and a NVIDIA Shield 2017 version.
App mode
TV