Kodi Community Forum

Full Version: Matrix 19.1: Flash (flv) with DRM Prime decoder cause crashes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all! Discovered an interesting little bug today when trying to playback flash (flv) video

When I set "Allow using DRM PRIME decoder" on, but disable hw accel with DRM PRIME, then playback of basically any media file gets a "std::bad_alloc" and a crash.

With both on, 4K plays well but flash (flv) files don't play - it tries for awhile and then also crashes with the same error.

With both off, flash (flv) files play perfect, but then all the HD files won't play at all (corrupted video and lag)

This behavior was not an issue on Leia.

I expect related to this:
https://github.com/xbmc/xbmc/pull/17724/files

FLV playback logs this:
2021-05-23 20:26:07.258 T:11246 ERROR <general>: ffmpeg[0x2a22c00X]: [vp6f] get_buffer() failed
2021-05-23 20:26:07.258 T:11246 ERROR <general>: ffmpeg[0x2a22c00X]: [IMGUTILS] Picture size 0x0 is invalid
2021-05-23 20:26:07.258 T:11246 ERROR <general>: CDVDVideoCodecDRMPRIME::AddData - send packet failed: Operation not permitted (-1)

I've confirmed FLV plays fine in ffmpeg, and obviously Kodi CAN play it with drm prime disabled, but the nothing else will play.

I posted this on discord but seems kinda quiet in there.
Just as an update, if I tell GetBuffer to fall back to avcodec_default_get_buffer2 instead of returning -1, the audio for the FLV plays, but there's no video. There's clearly some other things that need to happen, like maybe setting the hint to force software? But GetBuffer is static so I can't easily pass values back out of it and the return value for get_buffer2 is a pointer and it's not happy with me trying to compare it with the -1. I'll look at it more tomorrow, open for ideas.
To anyone interested... I was correct about that commit being the issue. To make the video play properly the decoder check needed to be adjusted, so I authored a patch that allows getbuffer to fall back to using the default and when this occurs it reallocates the context and reopens the media.

Thanks for reading! Big Grin