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
8 changes: 8 additions & 0 deletions av/codec/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,14 @@ def decode(self, packet: Packet | None = None):
you do not want the library to automatically re-order frames for you
(if they are encoded with a codec that has B-frames).

.. warning::

This method is **not thread-safe**. Calling :meth:`decode` concurrently
from multiple threads on the same :class:`CodecContext` will corrupt
internal FFmpeg state and likely cause a crash (segfault). FFmpeg 8.1
enforces this more strictly than earlier releases. If you need to decode
from multiple threads, give each thread its own :class:`CodecContext`.

"""
if not self.codec.ptr:
raise ValueError("cannot decode unknown codec")
Expand Down
Loading