Mercurial > mplayer.hg
comparison path.c @ 30907:b32527b30d17
Get rid of pointless def_path variable; use codec_path directly instead.
author | diego |
---|---|
date | Tue, 23 Mar 2010 18:01:00 +0000 |
parents | f405a747a35a |
children | 18338ee51c9d |
comparison
equal
deleted
inserted
replaced
30906:a34f16fb8823 | 30907:b32527b30d17 |
---|---|
174 if (!SetEnvironmentVariableA("PATH", win32path)) | 174 if (!SetEnvironmentVariableA("PATH", win32path)) |
175 mp_msg(MSGT_WIN32, MSGL_WARN, "Cannot set PATH!"); | 175 mp_msg(MSGT_WIN32, MSGL_WARN, "Cannot set PATH!"); |
176 } | 176 } |
177 #endif /* (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL) */ | 177 #endif /* (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL) */ |
178 | 178 |
179 char *def_path = BINARY_CODECS_PATH; | 179 char *codec_path = BINARY_CODECS_PATH; |
180 | 180 |
181 static int needs_free = 0; | 181 static int needs_free = 0; |
182 | 182 |
183 void set_codec_path(const char *path) | 183 void set_codec_path(const char *path) |
184 { | 184 { |
185 if (needs_free) | 185 if (needs_free) |
186 free(def_path); | 186 free(codec_path); |
187 if (path == 0) { | 187 if (path == 0) { |
188 def_path = BINARY_CODECS_PATH; | 188 codec_path = BINARY_CODECS_PATH; |
189 needs_free = 0; | 189 needs_free = 0; |
190 return; | 190 return; |
191 } | 191 } |
192 def_path = malloc(strlen(path) + 1); | 192 codec_path = malloc(strlen(path) + 1); |
193 strcpy(def_path, path); | 193 strcpy(codec_path, path); |
194 needs_free = 1; | 194 needs_free = 1; |
195 } | 195 } |