diff options
Diffstat (limited to 'Alc/backends/opensl.c')
-rw-r--r-- | Alc/backends/opensl.c | 59 |
1 files changed, 24 insertions, 35 deletions
diff --git a/Alc/backends/opensl.c b/Alc/backends/opensl.c index c1283111..7edc9ff8 100644 --- a/Alc/backends/opensl.c +++ b/Alc/backends/opensl.c @@ -160,7 +160,6 @@ static int ALCopenslPlayback_mixerProc(void *arg); static void ALCopenslPlayback_Construct(ALCopenslPlayback *self, ALCdevice *device); static void ALCopenslPlayback_Destruct(ALCopenslPlayback *self); static ALCenum ALCopenslPlayback_open(ALCopenslPlayback *self, const ALCchar *name); -static void ALCopenslPlayback_close(ALCopenslPlayback *self); static ALCboolean ALCopenslPlayback_reset(ALCopenslPlayback *self); static ALCboolean ALCopenslPlayback_start(ALCopenslPlayback *self); static void ALCopenslPlayback_stop(ALCopenslPlayback *self); @@ -194,7 +193,18 @@ static void ALCopenslPlayback_Construct(ALCopenslPlayback *self, ALCdevice *devi static void ALCopenslPlayback_Destruct(ALCopenslPlayback* self) { - ALCopenslPlayback_close(self); + if(self->mBufferQueueObj != NULL) + VCALL0(self->mBufferQueueObj,Destroy)(); + self->mBufferQueueObj = NULL; + + if(self->mOutputMix) + VCALL0(self->mOutputMix,Destroy)(); + self->mOutputMix = NULL; + + if(self->mEngineObj) + VCALL0(self->mEngineObj,Destroy)(); + self->mEngineObj = NULL; + self->mEngine = NULL; alcnd_destroy(&self->mCond); @@ -389,22 +399,6 @@ static ALCenum ALCopenslPlayback_open(ALCopenslPlayback *self, const ALCchar *na return ALC_NO_ERROR; } -static void ALCopenslPlayback_close(ALCopenslPlayback *self) -{ - if(self->mBufferQueueObj != NULL) - VCALL0(self->mBufferQueueObj,Destroy)(); - self->mBufferQueueObj = NULL; - - if(self->mOutputMix) - VCALL0(self->mOutputMix,Destroy)(); - self->mOutputMix = NULL; - - if(self->mEngineObj) - VCALL0(self->mEngineObj,Destroy)(); - self->mEngineObj = NULL; - self->mEngine = NULL; -} - static ALCboolean ALCopenslPlayback_reset(ALCopenslPlayback *self) { ALCdevice *device = STATIC_CAST(ALCbackend,self)->mDevice; @@ -710,7 +704,6 @@ static void ALCopenslCapture_process(SLAndroidSimpleBufferQueueItf bq, void *con static void ALCopenslCapture_Construct(ALCopenslCapture *self, ALCdevice *device); static void ALCopenslCapture_Destruct(ALCopenslCapture *self); static ALCenum ALCopenslCapture_open(ALCopenslCapture *self, const ALCchar *name); -static void ALCopenslCapture_close(ALCopenslCapture *self); static DECLARE_FORWARD(ALCopenslCapture, ALCbackend, ALCboolean, reset) static ALCboolean ALCopenslCapture_start(ALCopenslCapture *self); static void ALCopenslCapture_stop(ALCopenslCapture *self); @@ -749,7 +742,18 @@ static void ALCopenslCapture_Construct(ALCopenslCapture *self, ALCdevice *device static void ALCopenslCapture_Destruct(ALCopenslCapture *self) { - ALCopenslCapture_close(self); + ll_ringbuffer_free(self->mRing); + self->mRing = NULL; + + if(self->mRecordObj != NULL) + VCALL0(self->mRecordObj,Destroy)(); + self->mRecordObj = NULL; + + if(self->mEngineObj != NULL) + VCALL0(self->mEngineObj,Destroy)(); + self->mEngineObj = NULL; + self->mEngine = NULL; + ALCbackend_Destruct(STATIC_CAST(ALCbackend, self)); } @@ -918,21 +922,6 @@ static ALCenum ALCopenslCapture_open(ALCopenslCapture *self, const ALCchar *name return ALC_NO_ERROR; } -static void ALCopenslCapture_close(ALCopenslCapture *self) -{ - ll_ringbuffer_free(self->mRing); - self->mRing = NULL; - - if(self->mRecordObj != NULL) - VCALL0(self->mRecordObj,Destroy)(); - self->mRecordObj = NULL; - - if(self->mEngineObj != NULL) - VCALL0(self->mEngineObj,Destroy)(); - self->mEngineObj = NULL; - self->mEngine = NULL; -} - static ALCboolean ALCopenslCapture_start(ALCopenslCapture *self) { SLRecordItf record; |