mirror of
https://github.com/mpv-player/mpv
synced 2025-02-28 03:10:55 +00:00
Somewhat less ifdeffery, higher flexibility. Now there are 3 separate
config file resolvers for 3 platforms (unix, win, osx), and they can
still interact with each other somewhat. For example, OSX for now uses
most of Unix, but adds the OSX bundle path.
This can be extended to resolve very specific platform paths, such as
location of the desktop.
Most of the Unix specific code moves to path-unix.c.
The behavior should be the same - if not, it is likely a bug.
(cherry picked from commit d3a3cfe54c
)
33 lines
1.1 KiB
Objective-C
33 lines
1.1 KiB
Objective-C
/*
|
|
* This file is part of mpv.
|
|
*
|
|
* mpv is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* mpv is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along
|
|
* with mpv. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#import <Foundation/Foundation.h>
|
|
#include "options/path.h"
|
|
#include "osdep/path.h"
|
|
|
|
const char *mp_get_platform_path_osx(void *talloc_ctx, const char *type)
|
|
{
|
|
if (strcmp(type, "osxbundle") == 0) {
|
|
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
|
NSString *path = [[NSBundle mainBundle] resourcePath];
|
|
char *res = talloc_strdup(talloc_ctx, [path UTF8String]);
|
|
[pool release];
|
|
return res;
|
|
}
|
|
return NULL;
|
|
}
|