From f223dd22e7d63817fec767d3d621182f6cecce3f Mon Sep 17 00:00:00 2001 From: WyattBlue Date: Sun, 1 Feb 2026 14:17:51 -0500 Subject: [PATCH 1/2] AVIndex, fix const warns --- av/index.pxd | 4 ++-- av/index.py | 14 ++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/av/index.pxd b/av/index.pxd index f8ab87835..d7098c2f0 100644 --- a/av/index.pxd +++ b/av/index.pxd @@ -2,8 +2,8 @@ cimport libav as lib cdef class IndexEntry: - cdef lib.AVIndexEntry *ptr - cdef _init(self, lib.AVIndexEntry *ptr) + cdef const lib.AVIndexEntry *ptr + cdef _init(self, const lib.AVIndexEntry *ptr) cdef class IndexEntries: cdef lib.AVStream *stream_ptr diff --git a/av/index.py b/av/index.py index 4cba7d37e..504da9576 100644 --- a/av/index.py +++ b/av/index.py @@ -6,7 +6,7 @@ @cython.cfunc -def wrap_index_entry(ptr: cython.pointer[lib.AVIndexEntry]) -> IndexEntry: +def wrap_index_entry(ptr: cython.pointer[cython.const[lib.AVIndexEntry]]) -> IndexEntry: obj: IndexEntry = IndexEntry(_cinit_bypass_sentinel) obj._init(ptr) return obj @@ -26,7 +26,7 @@ def __cinit__(self, sentinel): raise RuntimeError("cannot manually instantiate IndexEntry") @cython.cfunc - def _init(self, ptr: cython.pointer[lib.AVIndexEntry]): + def _init(self, ptr: cython.pointer[cython.const[lib.AVIndexEntry]]): self.ptr = ptr def __repr__(self): @@ -110,19 +110,17 @@ def __getitem__(self, index): if index < 0 or index >= n: raise IndexError(f"Index entries {index} out of bounds for size {n}") - c_idx = cython.declare(cython.int, index) + c_idx: cython.int = index + entry: cython.pointer[cython.const[lib.AVIndexEntry]] with cython.nogil: entry = lib.avformat_index_get_entry(self.stream_ptr, c_idx) - if entry == cython.NULL: raise IndexError("index entry not found") return wrap_index_entry(entry) - elif isinstance(index, slice): start, stop, step = index.indices(len(self)) return [self[i] for i in range(start, stop, step)] - else: raise TypeError("Index must be an integer or a slice") @@ -135,8 +133,8 @@ def search_timestamp( Returns an index into this object, or ``-1`` if no match is found. """ - c_timestamp = cython.declare(int64_t, timestamp) - flags = cython.declare(cython.int, 0) + c_timestamp: int64_t = timestamp + flags: cython.int = 0 if backward: flags |= lib.AVSEEK_FLAG_BACKWARD From 4b00efcceaa6c130fbb52e4ee4999553f8544251 Mon Sep 17 00:00:00 2001 From: WyattBlue Date: Sun, 1 Feb 2026 14:22:27 -0500 Subject: [PATCH 2/2] Update installation.rst --- docs/overview/installation.rst | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/docs/overview/installation.rst b/docs/overview/installation.rst index 5fa7fc860..35da507d8 100644 --- a/docs/overview/installation.rst +++ b/docs/overview/installation.rst @@ -24,7 +24,7 @@ See the `Conda quick install = 18.04 LTS -^^^^^^^^^^^^^^^^^^^ - -On **Ubuntu 18.04 LTS** everything can come from the default sources:: - - # General dependencies - sudo apt-get install -y python-dev pkg-config - - # Library components - sudo apt-get install -y \ - libavformat-dev libavcodec-dev libavdevice-dev \ - libavutil-dev libswscale-dev libswresample-dev libavfilter-dev - - Windows ^^^^^^^