def _make_filter(func, udata):
    if func:
        def f(ignored, stream, len):
            # FIXME: getting a negative len value here sometimes
            if len < 0:
                return
            stream = array.SDL_array(stream, len, c_ubyte)
            func(udata, stream)
        return _Mix_FilterFunc(f)
    else:
        return _Mix_FilterFunc()
dataset/ETHPy150Open los-cocos/cocos/cocos/audio/SDL/mixer.py/_make_filter/original