[FFmpeg-devel] fix SDL device on MacOS

Lukasz M lukasz.m.luki at gmail.com
Wed Jan 15 00:28:32 CET 2014


On 14 January 2014 23:23, Nicolas George <george at nsup.org> wrote:

> Le quintidi 25 nivôse, an CCXXII, Lukasz M a écrit :
> > I found solution here:
> >
> http://forums.libsdl.org/viewtopic.php?p=26230&sid=6ba7f9f0e12717d9ded502bf89dc5be2
> >
> > "I think the problem is that main is declared before SDL.h is included,
> you
> > should include SDL before main so that SDL substitutes main() with
> > SDL_main() and does it's internal initializations. You should also link
> > with SDLmain."
> > It solves the problem.
>
> That means SDL will work from ffmpeg, the command-line tool, but not from
> any other application built around lavd. I hope there is a better solution.
>

That's true.

Besides a crash there is another problem. After applying my patch window
has no decoration (title bar is whole white and no icons on it) and window
is no responsive, but there is a video displayed on it.
I tried my opengl dev and it also crashes without a patch. After paching
window looks normal. During resize I get opengl error, but its probably a
bug in my implementation.
After short research I believe crash cannot be fixed without my patch or
very dirty hacks.

Other solution I found is to set SDL_VIDEODRIVER=x11 (default is quartz)
both devices works without patching, but sdl crashes when window is resized
and opengl seems to get resize events randomly. (probably a bug in my
implementation)
Problem with x11 driver is that it require X11 app to be launched (it is
done automatically but doesn't look good) and that app is removed in 10.8.

To summarize: I have not idea what to do:) Mac implemntation of SDL 1.2
seems to be a bit crappy.
An option for sdl device can be added so user may pick driver.


More information about the ffmpeg-devel mailing list