summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/coreaudio/coreaudio.h4
-rw-r--r--modules/coreaudio/player.c8
-rw-r--r--modules/coreaudio/recorder.c8
3 files changed, 8 insertions, 12 deletions
diff --git a/modules/coreaudio/coreaudio.h b/modules/coreaudio/coreaudio.h
index 67cb7d5..a4d4edd 100644
--- a/modules/coreaudio/coreaudio.h
+++ b/modules/coreaudio/coreaudio.h
@@ -9,10 +9,10 @@ int audio_session_enable(void);
void audio_session_disable(void);
-int coreaudio_player_alloc(struct auplay_st **stp, struct auplay *ap,
+int coreaudio_player_alloc(struct auplay_st **stp, const struct auplay *ap,
struct auplay_prm *prm, const char *device,
auplay_write_h *wh, void *arg);
-int coreaudio_recorder_alloc(struct ausrc_st **stp, struct ausrc *as,
+int coreaudio_recorder_alloc(struct ausrc_st **stp, const struct ausrc *as,
struct media_ctx **ctx,
struct ausrc_prm *prm, const char *device,
ausrc_read_h *rh, ausrc_error_h *errh, void *arg);
diff --git a/modules/coreaudio/player.c b/modules/coreaudio/player.c
index fc53b8c..16cfa33 100644
--- a/modules/coreaudio/player.c
+++ b/modules/coreaudio/player.c
@@ -20,7 +20,7 @@
struct auplay_st {
- struct auplay *ap; /* inheritance */
+ const struct auplay *ap; /* inheritance */
AudioQueueRef queue;
AudioQueueBufferRef buf[BUFC];
pthread_mutex_t mutex;
@@ -51,8 +51,6 @@ static void auplay_destructor(void *arg)
AudioQueueDispose(st->queue, true);
}
- mem_deref(st->ap);
-
pthread_mutex_destroy(&st->mutex);
}
@@ -78,7 +76,7 @@ static void play_handler(void *userData, AudioQueueRef outQ,
}
-int coreaudio_player_alloc(struct auplay_st **stp, struct auplay *ap,
+int coreaudio_player_alloc(struct auplay_st **stp, const struct auplay *ap,
struct auplay_prm *prm, const char *device,
auplay_write_h *wh, void *arg)
{
@@ -94,7 +92,7 @@ int coreaudio_player_alloc(struct auplay_st **stp, struct auplay *ap,
if (!st)
return ENOMEM;
- st->ap = mem_ref(ap);
+ st->ap = ap;
st->wh = wh;
st->arg = arg;
diff --git a/modules/coreaudio/recorder.c b/modules/coreaudio/recorder.c
index 40156fa..c913485 100644
--- a/modules/coreaudio/recorder.c
+++ b/modules/coreaudio/recorder.c
@@ -16,7 +16,7 @@
struct ausrc_st {
- struct ausrc *as; /* inheritance */
+ const struct ausrc *as; /* inheritance */
AudioQueueRef queue;
AudioQueueBufferRef buf[BUFC];
pthread_mutex_t mutex;
@@ -48,8 +48,6 @@ static void ausrc_destructor(void *arg)
AudioQueueDispose(st->queue, true);
}
- mem_deref(st->as);
-
pthread_mutex_destroy(&st->mutex);
}
@@ -89,7 +87,7 @@ static void record_handler(void *userData, AudioQueueRef inQ,
}
-int coreaudio_recorder_alloc(struct ausrc_st **stp, struct ausrc *as,
+int coreaudio_recorder_alloc(struct ausrc_st **stp, const struct ausrc *as,
struct media_ctx **ctx,
struct ausrc_prm *prm, const char *device,
ausrc_read_h *rh, ausrc_error_h *errh, void *arg)
@@ -112,7 +110,7 @@ int coreaudio_recorder_alloc(struct ausrc_st **stp, struct ausrc *as,
return ENOMEM;
st->ptime = prm->ptime;
- st->as = mem_ref(as);
+ st->as = as;
st->rh = rh;
st->arg = arg;