Mercurial > mplayer.hg
comparison mpcommon.c @ 35619:9ca9775defff
Call sanitize_os already in preinit function instead of only during init.
Possibly fixes some cases where Windows would still show a "No Disk" error dialog instead
of failing the open() function.
author | reimar |
---|---|
date | Sun, 06 Jan 2013 09:45:34 +0000 |
parents | 014d0c671b80 |
children | 3edaed3c1d60 |
comparison
equal
deleted
inserted
replaced
35618:2cf9f80c4023 | 35619:9ca9775defff |
---|---|
455 #endif /* CONFIG_GUI */ | 455 #endif /* CONFIG_GUI */ |
456 {NULL, NULL, 0, 0, 0, 0, NULL} | 456 {NULL, NULL, 0, 0, 0, 0, NULL} |
457 }; | 457 }; |
458 | 458 |
459 /** | 459 /** |
460 * Initialization code to be run at the very start, must not depend | |
461 * on option values. | |
462 */ | |
463 void common_preinit(void) | |
464 { | |
465 InitTimer(); | |
466 srand(GetTimerMS()); | |
467 | |
468 mp_msg_init(); | |
469 } | |
470 | |
471 /** | |
472 * Code to fix any kind of insane defaults some OS might have. | 460 * Code to fix any kind of insane defaults some OS might have. |
473 * Currently mostly fixes for insecure-by-default Windows. | 461 * Currently mostly fixes for insecure-by-default Windows. |
474 */ | 462 */ |
475 static void sanitize_os(void) | 463 static void sanitize_os(void) |
476 { | 464 { |
490 timeBeginPeriod(1); | 478 timeBeginPeriod(1); |
491 #endif | 479 #endif |
492 } | 480 } |
493 | 481 |
494 /** | 482 /** |
483 * Initialization code to be run at the very start, must not depend | |
484 * on option values. | |
485 */ | |
486 void common_preinit(void) | |
487 { | |
488 sanitize_os(); | |
489 InitTimer(); | |
490 srand(GetTimerMS()); | |
491 | |
492 mp_msg_init(); | |
493 } | |
494 | |
495 /** | |
495 * Initialization code to be run after command-line parsing. | 496 * Initialization code to be run after command-line parsing. |
496 */ | 497 */ |
497 int common_init(void) | 498 int common_init(void) |
498 { | 499 { |
499 #if (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL) | 500 #if (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL) |
500 set_path_env(); | 501 set_path_env(); |
501 #endif | 502 #endif |
502 sanitize_os(); | |
503 | 503 |
504 #ifdef CONFIG_PRIORITY | 504 #ifdef CONFIG_PRIORITY |
505 set_priority(); | 505 set_priority(); |
506 #endif | 506 #endif |
507 | 507 |