Commits

Lenard Lindstrom committed fb8a50e

Remove mixer.c dependency on PyBuffer_FillInfo

This frees the Py_buffer structure for use in Python 2.5 and earlier,
where the new buffer protocol is unsupported (Py_buffer is defined in
pgcompat.h in this case.) The pygame.mixer.Sound object's array interface
support can now be implemented in terms of the Py_buffer conversion routines
added to the pygame.base module C api.

  • Participants
  • Parent commits b11129a

Comments (0)

Files changed (1)

                 PyErr_NoMemory();
                 return -1;
             }
-	    view->internal = shape;
             if (fortran_order) {
                 shape[0] = channels;
                 shape[ndim - 1] = samples;
         }
     }
 
-    if (PyBuffer_FillInfo(view, obj, chunk->abuf, chunk->alen, 0, flags)) {
-        return -1;
-    }
-    if (flags != PyBUF_SIMPLE) {
-        view->format = format;
-        view->ndim = ndim;
-        view->shape = shape;
-        view->strides = strides;
-        view->itemsize = itemsize;
-    }
+    Py_INCREF(obj);
+    view->obj = obj;
+    view->buf = chunk->abuf;
+    view->len = (Py_ssize_t)chunk->alen;
+    view->readonly = 0;
+    view->itemsize = itemsize;
+    view->format = format;
+    view->ndim = ndim;
+    view->shape = shape;
+    view->strides = strides;
+    view->suboffsets = 0;
+    view->internal = shape;
     return 0;
 }