Commit Graph

7 Commits

Author SHA1 Message Date
Stefano Pigozzi fe7fed590a macosx: always active bundle path lookup if cocoa is active
This is not really something you want to disable anyway. If there is no bundle
the code already does it's falbacks anyway.
2013-09-12 18:45:40 +02:00
Martin Herkt be96a25dad mpvcore/path: Fix non-MinGW builds
Well that was dumb.
2013-09-12 18:26:14 +02:00
Martin Herkt 63c61500b8 mpvcore/path: Fix config path handling on Windows
Previously, mpv incorrectly used the %HOME% environment variable on
MinGW to determine the current user’s home directory. This is wrong;
the correct variable to use would be %HOMEPATH%, which would however
still be wrong since application data goes into the application data
directory, not the user’s home. This patch makes it use the local
AppData path instead of reading an environment variable.

This however exposed another problem (which also affected users who
actually had the %HOME% variable set):
b2c2fe7a37 (discussed in issue #95) introduced some changes that
make mpv load user config files from the executable path on Windows.
The problem with this change is that config_dir was still declared
static, so once a config file had been found in the executable path,
it would set config_dir to an empty string, so mpv would dump e.g.
watch_later data straight into the user’s home. This commit also
fixes that.

One side effect of this is that mpv no longer considers the “mpv”
subdirectory in the executable path (that behavior resulted from
the homedir variable always being empty), unless it is somehow
unable to determine the local AppData path.
2013-09-12 18:02:57 +02:00
wm4 191ac00af2 path: better check for mp_is_url()
The previous check just searched for a "://" substring. This was quite
bad, because "://" can be a valid part of a path. Later, I added
special handling for filenames starting with "." and "/", so that you
could reliably pass arbitrary filenames to mpv, no matter how messed
up they were.

Even though it doesn't really matter in practise anymore, this is still
crap, so add a more reliable check instead.
2013-09-04 16:28:02 +02:00
wm4 efc5ac17bf path: add a common mp_is_url() function
Remove the duplicated code.
2013-09-04 16:15:08 +02:00
Stefano Pigozzi 406241005e core: move contents to mpvcore (2/2)
Followup commit. Fixes all the files references.
2013-08-06 22:52:31 +02:00
Stefano Pigozzi bc27f946c2 core: move contents to mpvcore (1/2)
core is used in many unix systems for core dumps. For that reason some tools
work under the assumption that the file is indeed a core dump (for example
autoconf does this).

This commit just renames the files. The following one will change all the
includes to fix compilation. This is done this way because git has a easier
time tracing file changes if there is a pure rename commit.
2013-08-06 22:48:47 +02:00