diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-12-07 21:01:44 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-12-07 21:01:44 +0000 |
commit | 4d14f67cd579bf4831293b75b4f24a135cff05b3 (patch) | |
tree | 21087e559cc4e9333b6c3366ed4a21040719b199 /src/conversation/conversation_api_call.c | |
parent | eb48b0fb4f5e61a5a4b65378a647b7717b011020 (diff) | |
download | gnunet-4d14f67cd579bf4831293b75b4f24a135cff05b3.tar.gz gnunet-4d14f67cd579bf4831293b75b4f24a135cff05b3.zip |
-perform mic/speaker operations before event callbacks
Diffstat (limited to 'src/conversation/conversation_api_call.c')
-rw-r--r-- | src/conversation/conversation_api_call.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/conversation/conversation_api_call.c b/src/conversation/conversation_api_call.c index 8722e2452..c3d414a50 100644 --- a/src/conversation/conversation_api_call.c +++ b/src/conversation/conversation_api_call.c | |||
@@ -215,10 +215,10 @@ handle_call_suspend (void *cls, | |||
215 | break; | 215 | break; |
216 | case CS_ACTIVE: | 216 | case CS_ACTIVE: |
217 | call->state = CS_SUSPENDED_CALLEE; | 217 | call->state = CS_SUSPENDED_CALLEE; |
218 | call->event_handler (call->event_handler_cls, | ||
219 | GNUNET_CONVERSATION_EC_CALL_SUSPENDED); | ||
220 | call->speaker->disable_speaker (call->speaker->cls); | 218 | call->speaker->disable_speaker (call->speaker->cls); |
221 | call->mic->disable_microphone (call->mic->cls); | 219 | call->mic->disable_microphone (call->mic->cls); |
220 | call->event_handler (call->event_handler_cls, | ||
221 | GNUNET_CONVERSATION_EC_CALL_SUSPENDED); | ||
222 | break; | 222 | break; |
223 | case CS_SHUTDOWN: | 223 | case CS_SHUTDOWN: |
224 | GNUNET_CONVERSATION_call_stop (call); | 224 | GNUNET_CONVERSATION_call_stop (call); |
@@ -328,6 +328,8 @@ handle_call_hangup (void *cls, | |||
328 | const struct GNUNET_MessageHeader *msg) | 328 | const struct GNUNET_MessageHeader *msg) |
329 | { | 329 | { |
330 | struct GNUNET_CONVERSATION_Call *call = cls; | 330 | struct GNUNET_CONVERSATION_Call *call = cls; |
331 | GNUNET_CONVERSATION_CallEventHandler eh; | ||
332 | void *eh_cls; | ||
331 | 333 | ||
332 | switch (call->state) | 334 | switch (call->state) |
333 | { | 335 | { |
@@ -340,9 +342,10 @@ handle_call_hangup (void *cls, | |||
340 | case CS_SUSPENDED_CALLEE: | 342 | case CS_SUSPENDED_CALLEE: |
341 | case CS_SUSPENDED_BOTH: | 343 | case CS_SUSPENDED_BOTH: |
342 | case CS_ACTIVE: | 344 | case CS_ACTIVE: |
343 | call->event_handler (call->event_handler_cls, | 345 | eh = call->event_handler; |
344 | GNUNET_CONVERSATION_EC_CALL_HUNG_UP); | 346 | eh_cls = call->event_handler_cls; |
345 | GNUNET_CONVERSATION_call_stop (call); | 347 | GNUNET_CONVERSATION_call_stop (call); |
348 | eh (eh_cls, GNUNET_CONVERSATION_EC_CALL_HUNG_UP); | ||
346 | return; | 349 | return; |
347 | case CS_SHUTDOWN: | 350 | case CS_SHUTDOWN: |
348 | GNUNET_CONVERSATION_call_stop (call); | 351 | GNUNET_CONVERSATION_call_stop (call); |