Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

melt playing window stopped refresh after resized #783

Open
chengyingyuan opened this issue Mar 25, 2022 · 2 comments
Open

melt playing window stopped refresh after resized #783

chengyingyuan opened this issue Mar 25, 2022 · 2 comments

Comments

@chengyingyuan
Copy link

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?

@chengyingyuan
Copy link
Author

chengyingyuan commented Mar 31, 2022

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.

changes.zip

@xfc1939
Copy link

xfc1939 commented Jul 15, 2022

我碰到了一样的问题,修改consumer_sdl2.c,将setup_sdl_video放到video_thread线程初始化就正常了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants