Crash when changing media started with VLCKit-3.4.1b12
Hi,
today I compiled VLCKit-3.4.1b12 and linked the new version of the framework to an existing app. While I'm on cloud nine because it fixes #486 (closed), I'm now regularly experiencing a crash that was not occurring with 3.4.1b11 or any previous release.
Premise: I haven't changed any code in my app, just updated the framework and then reverted to the previous one to double check.
Here's how I trigger the crash:
-
My app launches and automatically starts playing a RTSP stream selected in the previous session. Everything works fine and continues to do so as long as I keep playing the same stream: I can minimize, resize, wait around for minutes... rock solid. Starting with different streams does not affect the outcome.
-
As soon as I decide to switch to a different RTSP stream and touch the designed button in my UI to do so, this new crash immediately occurs:
-
The same crash also occurs if I reload the current stream (which, within my application, basically performs the same operations – which I'll list below – as switching to a different stream, so it sort of make sense that the crash is also occurring in this scenario).
Every time the app crashes, I see the following message logged (the number at the end changes every time):
WARNING: undefined meta type : 54172224
A couple of times, I also saw this message logged, but I'm less sure it's relevant:
VLCKit was compiled with optimization - stepping may behave oddly; variables may not be available
Now, even if it's code that worked for years, I obviously wonder if I'm doing something wrong when switching to a different video stream. Here's a quick ordered list of what my code does when switching from a stream currently playing to a different one:
- I stop playback with
mediaPlayer?.stop()
; - I reset the mediaPlayer with
mediaPlayer = VLCMediaPlayer(options: options)
(such options depend from the stream URL, so I need to pass different arrays for each stream), set the delegate (mediaPlayer?.delegate = self
) and then the drawable (mediaPlayer?.drawable = videoView
); - I select the media with
mediaPlayer?.media = playlist?.media(at: UInt(myIndex))
; I don't modify the playlist when switching media, as it was initialized upon launch (or when the User edits the saved URLs) by callingVLCMediaList(array: mediaArray!)
, with thatVLCMedia
array already containing all possible stream URLs to cycle through; - I start playBack with
mediaPlayer?.play()
.
Again, it's entirely possible that I'm doing something wrong in the procedure above, but again it worked until today. Hence my decision to open this issue and ask for help.
What follows is pure speculation on my part and most likely wrong, as I'm completely out of my league, but I understand some changes occurred to VLCEventManager
in the last release, and I notice libvlc_event_send
in the stack trace; if the two things are connected among them and with my crash, I have no idea.
Another thing I'm noticing and might or might not be relevant in the stack is a call to [VLCMedia metaChanged:]
, which I don't believe I've ever seen before (and I've also never seen the undefined meta type warning in the console)... Since I'm under the impression the crash is caused by me "changing the media" under the feet of the media player, maybe this could help someone wiser than myself to figure out what's going on.
Finally, it would also be interesting to know if this crash is only happening to me, as that would prove that's something wrong in my implementation.
I hope I provided enough informations. I'll keep testing on my part and update this issue if I notice anything else.
Thank you in advance!