]> git.sesse.net Git - x264/blobdiff - extras/avisynth_c.h
Detect Avisynth initialization failures
[x264] / extras / avisynth_c.h
index 64deaadfc1c092045f7228691bdc82002318185f..5044efb0aa6816eac59c80c9a85b422d588cb2a4 100644 (file)
@@ -552,7 +552,7 @@ AVSC_INLINE int avs_array_size(AVS_Value v)
 AVSC_INLINE AVS_Value avs_array_elt(AVS_Value v, int index) 
         { return avs_is_array(v) ? v.d.array[index] : v; }
 
-// only use these functions on am AVS_Value that does not already have
+// only use these functions on an AVS_Value that does not already have
 // an active value.  Remember, treat AVS_Value as a fat pointer.
 AVSC_INLINE AVS_Value avs_new_value_bool(int v0) 
         { AVS_Value v; v.type = 'b'; v.d.boolean = v0 == 0 ? 0 : 1; return v; }   
@@ -660,6 +660,7 @@ enum {
   AVS_CPUF_SSE4_2     = 0x800,   //  Nehalem
 };
 
+AVSC_API(const char *, avs_get_error)(AVS_ScriptEnvironment *); // return 0 if no error
 
 AVSC_API(long, avs_get_cpu_flags)(AVS_ScriptEnvironment *);
 AVSC_API(int, avs_check_version)(AVS_ScriptEnvironment *, int version);
@@ -771,6 +772,7 @@ struct AVS_Library {
   AVSC_DECLARE_FUNC(avs_function_exists);
   AVSC_DECLARE_FUNC(avs_get_audio);
   AVSC_DECLARE_FUNC(avs_get_cpu_flags);
+  AVSC_DECLARE_FUNC(avs_get_error);
   AVSC_DECLARE_FUNC(avs_get_frame);
   AVSC_DECLARE_FUNC(avs_get_parity);
   AVSC_DECLARE_FUNC(avs_get_var);
@@ -829,6 +831,7 @@ AVSC_INLINE AVS_Library * avs_load_library() {
   AVSC_LOAD_FUNC(avs_function_exists);
   AVSC_LOAD_FUNC(avs_get_audio);
   AVSC_LOAD_FUNC(avs_get_cpu_flags);
+  AVSC_LOAD_FUNC(avs_get_error);
   AVSC_LOAD_FUNC(avs_get_frame);
   AVSC_LOAD_FUNC(avs_get_parity);
   AVSC_LOAD_FUNC(avs_get_var);