diff --git a/av/error.py b/av/error.py index 77fce88d1..669c8e55a 100644 --- a/av/error.py +++ b/av/error.py @@ -10,7 +10,7 @@ from cython.cimports.libc.stdio import fprintf, stderr from cython.cimports.libc.stdlib import free, malloc -# Will get extended with all of the exceptions. +# Will get extended with all the exceptions. __all__ = [ "ErrorType", "FFmpegError", @@ -117,8 +117,8 @@ def __str__(self): # Our custom error, used in callbacks. -c_PYAV_STASHED_ERROR: cython.int = tag_to_code(b"PyAV") -PYAV_STASHED_ERROR_message: str = "Error in PyAV callback" +c_PYAV_STASHED_ERROR = cython.declare(cython.int, tag_to_code(b"PyAV")) +PYAV_STASHED_ERROR_message = cython.declare(str, "Error in PyAV callback") # Bases for the FFmpeg-based exceptions. @@ -342,8 +342,9 @@ class UndefinedError(FFmpegError): # Storage for stashing. -_local: object = local() -_err_count: cython.int = 0 +_local = cython.declare(object, local()) +_err_count = cython.declare(cython.int, 0) +_last_log_count = cython.declare(cython.int, 0) @cython.cfunc @@ -364,9 +365,6 @@ def stash_exception(exc_info=None) -> cython.int: return -c_PYAV_STASHED_ERROR -_last_log_count: cython.int = 0 - - @cython.ccall @cython.exceptval(-1, check=False) def err_check(res: cython.int, filename=None) -> cython.int: