Firmware 1.13.0-beta6 Crash: video:getContext() is broken

Since my playdate was updated to 1.13.0-beta6, the following sample code print nil for the video context

basePath = "levels/LEVEL01"
print("Loading video", basePath)
video, errorMsg = playdate.graphics.video.new(basePath)
frameCount = video:getFrameCount()
print("error is", errorMsg, "frameCount is ", frameCount, "context is", video:getContext())

Loading video levels/LEVEL01
error is nil frameCount is 114 context is nil

The sample video has pretty small dimensions of 164x64, but the same happens with a 400x240 video.
This worked fine on hardware with firmware 1.12.3 and also the current 1.12.3 simulator:

Loading video levels/LEVEL01
error is nil frameCount is 114 context is playdate.graphics.image: 0x7fa2e2064398

LEVEL01.pdv.zip (15.0 KB)

oh, yep, I think I see what's happening. I changed from using a hacked-together reference system to lua_setiuservalue(). getContext() lazily creates the context, and in that code change I forgot to add a duplicate of the image object for returning. It should work as expected if you call video:getContext() a second time.

Thanks for catching that!

Can confirm this workaround works; I almost tried this myself after reading in the documentation that the context would be created upon first call to this function

1 Like

Since my playdate was updated to 1.13.0-beta6

Silly question but where do we find this beta SDK/Firmware?

I've asked if there was a beta program in the past, so I could test toybox.py against future versions of the SDK, but never got an answer... :slightly_frowning_face:

It may be based on playdate serial number. My playdate is a "developer preview" unit from before mass production