diff --git a/src/imports/avs.h b/src/imports/avs.h index 9dce5beb..ae054e5c 100644 --- a/src/imports/avs.h +++ b/src/imports/avs.h @@ -221,7 +221,7 @@ int property_set_flag(struct property *prop, int flags, int mask); void property_destroy(struct property *prop); avs_error property_get_error(struct property *prop); -struct property *property_clear_error(struct property *prop); +void property_clear_error(struct property *prop); int property_psmap_import( struct property *prop, diff --git a/src/main/avs-util/error.c b/src/main/avs-util/error.c index ab09c014..d31b2e18 100644 --- a/src/main/avs-util/error.c +++ b/src/main/avs-util/error.c @@ -96,4 +96,14 @@ const char *avs_util_error_str(avs_error error) } return avs_util_error_unknown; +} + +const char *avs_util_property_error_get_and_clear(struct property *prop) +{ + avs_error error; + + error = property_get_error(prop); + property_clear_error(prop); + + return avs_util_error_str(error); } \ No newline at end of file diff --git a/src/main/avs-util/error.h b/src/main/avs-util/error.h index 35988515..88d68c5b 100644 --- a/src/main/avs-util/error.h +++ b/src/main/avs-util/error.h @@ -5,4 +5,6 @@ const char *avs_util_error_str(avs_error error); -#endif \ No newline at end of file +const char *avs_util_property_error_get_and_clear(struct property *prop); + +#endif