mirror of
https://github.com/mpv-player/mpv
synced 2025-03-23 03:37:27 +00:00
Corrected my mistake in the last memfix patch.
Bug was discovered by Shachar Raindel <shacharr@gmail.com>. The basic patch idea is also from him. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12943 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
50570ae820
commit
0f6c8c765a
@ -1484,15 +1484,24 @@ mp_input_init(void) {
|
|||||||
if(!file)
|
if(!file)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( mp_input_parse_config(file)) {
|
if( !mp_input_parse_config(file)) {
|
||||||
free(file); // release the buffer created by get_path()
|
// free file if it was allocated by get_path(),
|
||||||
}
|
// before it gets overwritten
|
||||||
else {
|
if( file != config_file)
|
||||||
|
{
|
||||||
|
free(file);
|
||||||
|
}
|
||||||
// Try global conf dir
|
// Try global conf dir
|
||||||
file = MPLAYER_CONFDIR "/input.conf";
|
file = MPLAYER_CONFDIR "/input.conf";
|
||||||
if(! mp_input_parse_config(file))
|
if(! mp_input_parse_config(file))
|
||||||
mp_msg(MSGT_INPUT,MSGL_WARN,"Falling back on default (hardcoded) input config\n");
|
mp_msg(MSGT_INPUT,MSGL_WARN,"Falling back on default (hardcoded) input config\n");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// free file if it was allocated by get_path()
|
||||||
|
if( file != config_file)
|
||||||
|
free(file);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAVE_JOYSTICK
|
#ifdef HAVE_JOYSTICK
|
||||||
if(use_joystick) {
|
if(use_joystick) {
|
||||||
|
Loading…
Reference in New Issue
Block a user