diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-08-26 20:34:26 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-09-03 20:03:47 +0000 |
commit | 6872c14e1a02445d945623ee6e85230c5d7ecbce (patch) | |
tree | 30d90b93445976e56b96946b6e87b764eddd48a8 /toxav/audio.c | |
parent | d296490a742b226fc17a71cf96ab73fc16719b20 (diff) |
Avoid use of global mutable state in mono_time on win32.
This uses a trick to get read-write access to `this` from a `const`
member function, similar to C++ `mutable`, but uglier.
Diffstat (limited to 'toxav/audio.c')
-rw-r--r-- | toxav/audio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/toxav/audio.c b/toxav/audio.c index 5da41570..de007424 100644 --- a/toxav/audio.c +++ b/toxav/audio.c | |||
@@ -44,7 +44,7 @@ static bool reconfigure_audio_decoder(ACSession *ac, int32_t sampling_rate, int8 | |||
44 | 44 | ||
45 | 45 | ||
46 | 46 | ||
47 | ACSession *ac_new(const Mono_Time *mono_time, const Logger *log, ToxAV *av, uint32_t friend_number, | 47 | ACSession *ac_new(Mono_Time *mono_time, const Logger *log, ToxAV *av, uint32_t friend_number, |
48 | toxav_audio_receive_frame_cb *cb, void *cb_data) | 48 | toxav_audio_receive_frame_cb *cb, void *cb_data) |
49 | { | 49 | { |
50 | ACSession *ac = (ACSession *)calloc(sizeof(ACSession), 1); | 50 | ACSession *ac = (ACSession *)calloc(sizeof(ACSession), 1); |
@@ -216,7 +216,7 @@ void ac_iterate(ACSession *ac) | |||
216 | pthread_mutex_unlock(ac->queue_mutex); | 216 | pthread_mutex_unlock(ac->queue_mutex); |
217 | } | 217 | } |
218 | 218 | ||
219 | int ac_queue_message(const Mono_Time *mono_time, void *acp, struct RTPMessage *msg) | 219 | int ac_queue_message(Mono_Time *mono_time, void *acp, struct RTPMessage *msg) |
220 | { | 220 | { |
221 | if (!acp || !msg) { | 221 | if (!acp || !msg) { |
222 | return -1; | 222 | return -1; |