1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-24 15:52:25 +00:00

osx: terminate argv properly when arguments are removed

The player now relies on the (slightly obscure) requirement that argv is
NULL-terminated.

Might fix #1652.
This commit is contained in:
wm4 2015-03-06 10:48:34 +01:00
parent e9ff136dd3
commit 4dd7104af8

View File

@ -366,7 +366,10 @@ int cocoa_main(mpv_main_fn mpv_main, int argc, char *argv[])
ctx.argv = &argv; ctx.argv = &argv;
if (bundle_started_from_finder(argc, argv)) { if (bundle_started_from_finder(argc, argv)) {
argc = 1; // clears out -psn argument is present if (argc > 1) {
argc = 1; // clears out -psn argument if present
argv[1] = NULL;
}
macosx_redirect_output_to_logfile("mpv"); macosx_redirect_output_to_logfile("mpv");
init_cocoa_application(true); init_cocoa_application(true);
} else { } else {