[VLCKit] Lost video layer causes deadlock
In VLCKit I've detected a bug which eventually causes deadlock. This bug can also be reproduced in VLC for iOS application. Here are the steps:
- Open “Media Library > All Files” screen
- Create a new folder
- Upload at least 2 videos into this folder via iTunes
- Click the folder to list the video items
- Open the first video
- While the first video is playing, send the application to the background (via home button)
- As the app is in background, wait for finishing of first video.
- When the second video is automatically started to play, bring back the application to foreground
- Now the video screen layer should seem to be lost. (issue 1)
- As the layer is lost, try to skip to previous or next video.
- Now the application should be frozen (issue 2)
When the issue 2 happens, I pause the process in Xcode debugger and see that it gets stuck in sem_wait()
function. Looks like there occurs some kind of deadlock here relating to semaphores.
This same bug also occured when I was using VLCKit to develop my own video player library. So I'm almost sure this is an internal bug in VLCKit.