Ideally you'd want to use the existing structure:
https://github.com/hrydgard/ppsspp/blob/0ba0dba63dcb17fde3d2020af722b32ca2f67789/Core/HW/MediaEngine.cpp#L255

This actually already handles videos with multiple video streams.  I'm not sure, it may be possible for the videos you're working with to have multiple streams.  It happens for example in Idolmaster I think was the name of the game...

This already creates the context once and deals with everything.  However, it expects the data to be placed onto the ringbuffer.  It seems to me that sceMpegbase_BEA18F91 either pushes things onto the ringbuffer or else replaces it with a linked list of packets.  Making it somehow enqueue them in the normal way would be simpler, if that can accurately represent the behavior.

Do you have a PSP?  Some of these things are significantly easier to get right, and to get right for all games not just the ones you're trying to fix at the moment, if you just test them on your PSP.  It needs to be jailbroken.

-[Unknown]