|
27 | 27 | #include <stdint.h> |
28 | 28 |
|
29 | 29 | /* New symbols must still be added to libmpv/mpv.def. */ |
30 | | -#if defined(__GNUC__) || defined(__clang__) |
31 | | -#define MPV_EXPORT __attribute__((visibility("default"))) |
32 | | -#elif defined(_MSC_VER) |
| 30 | +#ifdef _WIN32 |
33 | 31 | #define MPV_EXPORT __declspec(dllexport) |
| 32 | +#elif defined(__GNUC__) || defined(__clang__) |
| 33 | +#define MPV_EXPORT __attribute__((visibility("default"))) |
34 | 34 | #else |
35 | 35 | #define MPV_EXPORT |
36 | 36 | #endif |
@@ -152,8 +152,6 @@ extern "C" { |
152 | 152 | * - Using UNIX IPC (off by default) will override the SIGPIPE signal handler, |
153 | 153 | * and set it to SIG_IGN. Some invocations of the "subprocess" command will |
154 | 154 | * also do that. |
155 | | - * - mpv will reseed the legacy C random number generator by calling srand() at |
156 | | - * some random point once. |
157 | 155 | * - mpv may start sub processes, so overriding SIGCHLD, or waiting on all PIDs |
158 | 156 | * (such as calling wait()) by the parent process or any other library within |
159 | 157 | * the process must be avoided. libmpv itself only waits for its own PIDs. |
@@ -242,7 +240,7 @@ extern "C" { |
242 | 240 | * relational operators (<, >, <=, >=). |
243 | 241 | */ |
244 | 242 | #define MPV_MAKE_VERSION(major, minor) (((major) << 16) | (minor) | 0UL) |
245 | | -#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(2, 0) |
| 243 | +#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(2, 1) |
246 | 244 |
|
247 | 245 | /** |
248 | 246 | * The API user is allowed to "#define MPV_ENABLE_DEPRECATED 0" before |
@@ -1070,6 +1068,16 @@ MPV_EXPORT int mpv_set_property(mpv_handle *ctx, const char *name, mpv_format fo |
1070 | 1068 | */ |
1071 | 1069 | MPV_EXPORT int mpv_set_property_string(mpv_handle *ctx, const char *name, const char *data); |
1072 | 1070 |
|
| 1071 | +/** |
| 1072 | + * Convenience function to delete a property. |
| 1073 | + * |
| 1074 | + * This is equivalent to running the command "del [name]". |
| 1075 | + * |
| 1076 | + * @param name The property name. See input.rst for a list of properties. |
| 1077 | + * @return error code |
| 1078 | + */ |
| 1079 | +MPV_EXPORT int mpv_del_property(mpv_handle *ctx, const char *name); |
| 1080 | + |
1073 | 1081 | /** |
1074 | 1082 | * Set a property asynchronously. You will receive the result of the operation |
1075 | 1083 | * as MPV_EVENT_SET_PROPERTY_REPLY event. The mpv_event.error field will contain |
|
0 commit comments