Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions av/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down
Loading