Skip to content

Commit

Permalink
Fixed indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Dec 26, 2024
1 parent 3a9a3ab commit 903bd94
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions src/_avif.c
Original file line number Diff line number Diff line change
Expand Up @@ -606,10 +606,11 @@ _encoder_add(AvifEncoderObject *self, PyObject *args) {
// rgb.pixels is safe for writes
memcpy(rgb.pixels, rgb_bytes, size);

Py_BEGIN_ALLOW_THREADS result = avifImageRGBToYUV(frame, &rgb);
Py_END_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS;
result = avifImageRGBToYUV(frame, &rgb);
Py_END_ALLOW_THREADS;

if (result != AVIF_RESULT_OK) {
if (result != AVIF_RESULT_OK) {
PyErr_Format(
exc_type_for_avif_result(result),
"Conversion to YUV failed: %s",
Expand All @@ -624,11 +625,11 @@ _encoder_add(AvifEncoderObject *self, PyObject *args) {
addImageFlags |= AVIF_ADD_IMAGE_FLAG_SINGLE;
}

Py_BEGIN_ALLOW_THREADS result =
avifEncoderAddImage(encoder, frame, duration, addImageFlags);
Py_END_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS;
result = avifEncoderAddImage(encoder, frame, duration, addImageFlags);
Py_END_ALLOW_THREADS;

if (result != AVIF_RESULT_OK) {
if (result != AVIF_RESULT_OK) {
PyErr_Format(
exc_type_for_avif_result(result),
"Failed to encode image: %s",
Expand Down Expand Up @@ -660,10 +661,11 @@ _encoder_finish(AvifEncoderObject *self) {
avifResult result;
PyObject *ret = NULL;

Py_BEGIN_ALLOW_THREADS result = avifEncoderFinish(encoder, &raw);
Py_END_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS;
result = avifEncoderFinish(encoder, &raw);
Py_END_ALLOW_THREADS;

if (result != AVIF_RESULT_OK) {
if (result != AVIF_RESULT_OK) {
PyErr_Format(
exc_type_for_avif_result(result),
"Failed to finish encoding: %s",
Expand Down Expand Up @@ -876,10 +878,11 @@ _decoder_get_frame(AvifDecoderObject *self, PyObject *args) {
return NULL;
}

Py_BEGIN_ALLOW_THREADS result = avifImageYUVToRGB(image, &rgb);
Py_END_ALLOW_THREADS
Py_BEGIN_ALLOW_THREADS;
result = avifImageYUVToRGB(image, &rgb);
Py_END_ALLOW_THREADS;

if (result != AVIF_RESULT_OK) {
if (result != AVIF_RESULT_OK) {
PyErr_Format(
exc_type_for_avif_result(result),
"Conversion from YUV failed: %s",
Expand Down

0 comments on commit 903bd94

Please sign in to comment.