mlt
mlt copied to clipboard
melt playing window stopped refresh after resized
I built mlt-7.4.0 using mingw64 toolchain. When playing mp4 videos using command line tool melt, consumer_sdl2 is used, and the producer is avformat I guess. If I resized playing window, frame resized as well, but stopped refreshing afterwards, and audio played as normal as before.
I digged into source file consumer_sdl2.c, finding self->window_width is updated after resizing event, everything seems OK. I tried adding following line after window resized:
SDL_RenderSetViewport(self->sdl_renderer, NULL);
Nothing good happened.
It's frustrated me serveral days. Any advice to solve it?
After serveral days of hard work, I got an acceptable solution, although not elegant.
I changed consumer_sdl2.c to create an opengl context in function setup_sdl_video(), rendering frame from video_thread(), which is called from main thread of melt.c instead of a standalone thread. If I create opengl context in one thread and render in another one, nothing will be rendered.
To get the function address of video_thread() from melt.c, I set it as a property when consumer starts.
My patch is messy. Hope you great guys make a more reasonable solution.
我碰到了一样的问题,修改consumer_sdl2.c,将setup_sdl_video放到video_thread线程初始化就正常了