Unified · Split
| @@ -33,6 +33,7 @@ API changes · 32 unmodified lines | ||
| 33 | 33 | :: |
| 34 | 34 | |
| 35 | 35 | --- mpv 0.35.0 --- |
| 36 | + 2.1 - add mpv_del_property() | |
| 36 | 37 | 2.0 - remove headers/functions of the obsolete opengl_cb API |
| 37 | 38 | - remove mpv_opengl_init_params.extra_exts field |
| 38 | 39 | - remove deprecated mpv_detach_destroy. Use mpv_destroy instead. |
| @@ -240,7 +240,7 @@ extern "C" { · 239 unmodified lines | ||
| 240 | 240 | * relational operators (<, >, <=, >=). |
| 241 | 241 | */ |
| 242 | 242 | #define MPV_MAKE_VERSION(major, minor) (((major) << 16) | (minor) | 0UL) |
| 243 | −#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(2, 0) | |
| 243 | +#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(2, 1) | |
| 244 | 244 | |
| 245 | 245 | /** |
| 246 | 246 | * The API user is allowed to "#define MPV_ENABLE_DEPRECATED 0" before |
| @@ -1068,6 +1068,16 @@ MPV_EXPORT int mpv_set_property(mpv_handle *ctx, const char *name, mpv_format fo · 821 unmodified lines | ||
| 1068 | 1068 | */ |
| 1069 | 1069 | MPV_EXPORT int mpv_set_property_string(mpv_handle *ctx, const char *name, const char *data); |
| 1070 | 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 | + | |
| 1071 | 1081 | /** |
| 1072 | 1082 | * Set a property asynchronously. You will receive the result of the operation |
| 1073 | 1083 | * as MPV_EVENT_SET_PROPERTY_REPLY event. The mpv_event.error field will contain |
| @@ -1337,6 +1337,12 @@ int mpv_set_property(mpv_handle *ctx, const char *name, mpv_format format, · 1336 unmodified lines | ||
| 1337 | 1337 | return req.status; |
| 1338 | 1338 | } |
| 1339 | 1339 | |
| 1340 | +int mpv_del_property(mpv_handle *ctx, const char *name) | |
| 1341 | +{ | |
| 1342 | + const char* args[] = { "del", name, NULL }; | |
| 1343 | + return mpv_command(ctx, args); | |
| 1344 | +} | |
| 1345 | + | |
| 1340 | 1346 | int mpv_set_property_string(mpv_handle *ctx, const char *name, const char *data) |
| 1341 | 1347 | { |
| 1342 | 1348 | return mpv_set_property(ctx, name, MPV_FORMAT_STRING, &data); |