Skip to content

Commit 3fd310f

Browse files
committed
Avoid blocking all threads during AVIF decode
1 parent e41083f commit 3fd310f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/_avif.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,9 @@ _decoder_get_frame(AvifDecoderObject *self, PyObject *args) {
782782
return NULL;
783783
}
784784

785+
Py_BEGIN_ALLOW_THREADS;
785786
result = avifDecoderNthImage(decoder, frame_index);
787+
Py_END_ALLOW_THREADS;
786788
if (result != AVIF_RESULT_OK) {
787789
PyErr_Format(
788790
exc_type_for_avif_result(result),

0 commit comments

Comments
 (0)