mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-25 00:00:34 +03:00
Release GIL while calling WebPAnimDecoderGetNext
This commit is contained in:
parent
3e04ca5794
commit
469db5114c
|
@ -450,12 +450,16 @@ _anim_decoder_get_next(PyObject *self) {
|
|||
int timestamp;
|
||||
PyObject *bytes;
|
||||
PyObject *ret;
|
||||
ImagingSectionCookie cookie;
|
||||
WebPAnimDecoderObject *decp = (WebPAnimDecoderObject *)self;
|
||||
|
||||
ImagingSectionEnter(&cookie);
|
||||
if (!WebPAnimDecoderGetNext(decp->dec, &buf, ×tamp)) {
|
||||
ImagingSectionLeave(&cookie);
|
||||
PyErr_SetString(PyExc_OSError, "failed to read next frame");
|
||||
return NULL;
|
||||
}
|
||||
ImagingSectionLeave(&cookie);
|
||||
|
||||
bytes = PyBytes_FromStringAndSize(
|
||||
(char *)buf, decp->info.canvas_width * 4 * decp->info.canvas_height);
|
||||
|
|
Loading…
Reference in New Issue
Block a user