Skip to content

VLCMedia.storeCookie bug?

MobileVLCKit 3.3.16.3

Code that can confirm the problem for the time being

// It doesn't matter if it's a local or remote URL
let media = VLCMedia(url: url)
media.storeCookie("", forHost: "", path: "")
        
var mediaPlayer: VLCMediaPlayer? = .init(library: .shared())
mediaPlayer?.media = media
mediaPlayer?.play()
mediaPlayer?.stop()
mediaPlayer = nil

result

vlc_http_cookies_clear EXC_BAD_ACCESS

By the way, running media.clearStoredCookies () before mediaPlayer = nil did not change the result.

// It doesn't matter if it's a local or remote URL
let media = VLCMedia(url: url)
media.storeCookie("", forHost: "", path: "")
        
var mediaPlayer: VLCMediaPlayer? = .init(library: .shared())
mediaPlayer?.media = media
mediaPlayer?.play()
mediaPlayer?.stop()
media.clearStoredCookies()
mediaPlayer = nil

result

vlc_http_cookies_clear EXC_BAD_ACCESS

But it doesn't crash unless I call VLCMediaPlayer.play()

// It doesn't matter if it's a local or remote URL
let media = VLCMedia(url: url)
media.storeCookie("", forHost: "", path: "")

var mediaPlayer: VLCMediaPlayer? = .init(library: .shared())
mediaPlayer?.media = media
mediaPlayer = nil

result

Will not crash

It seems that vlc_http_cookies_clear crashes when VLCMedia.dealloc is called after setting a cookie on VLC Media and playing

Sorry for the confusing explanation

I thought it was a waste to not be able to use the functions that I could use.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information