From 9ba7cb7e76935e8e8c1ae0d5614cae2d248b22ae Mon Sep 17 00:00:00 2001 From: mannol Date: Wed, 12 Mar 2014 00:22:49 +0100 Subject: Removed logging to stderr and fixed timeout handling --- toxav/media.c | 8 ++++---- toxav/msi.c | 8 ++++---- toxav/rtp.c | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/toxav/media.c b/toxav/media.c index f6c33309..a9a4adb8 100644 --- a/toxav/media.c +++ b/toxav/media.c @@ -197,7 +197,7 @@ int init_video_decoder(CodecState *cs) { if (vpx_codec_dec_init_ver(&cs->v_decoder, VIDEO_CODEC_DECODER_INTERFACE, NULL, 0, VPX_DECODER_ABI_VERSION) != VPX_CODEC_OK) { - fprintf(stderr, "Init video_decoder failed!\n"); + /*fprintf(stderr, "Init video_decoder failed!\n");*/ return -1; } @@ -210,7 +210,7 @@ int init_audio_decoder(CodecState *cs, uint32_t audio_channels) cs->audio_decoder = opus_decoder_create(cs->audio_sample_rate, audio_channels, &rc ); if ( rc != OPUS_OK ) { - fprintf(stderr, "Error while starting audio decoder!\n"); + /*fprintf(stderr, "Error while starting audio decoder!\n");*/ return -1; } @@ -224,7 +224,7 @@ int init_video_encoder(CodecState *cs, uint16_t width, uint16_t height, uint32_t int res = vpx_codec_enc_config_default(VIDEO_CODEC_ENCODER_INTERFACE, &cfg, 0); if (res) { - fprintf(stderr, "Failed to get config: %s\n", vpx_codec_err_to_string(res)); + /*fprintf(stderr, "Failed to get config: %s\n", vpx_codec_err_to_string(res));*/ return -1; } @@ -234,7 +234,7 @@ int init_video_encoder(CodecState *cs, uint16_t width, uint16_t height, uint32_t if (vpx_codec_enc_init_ver(&cs->v_encoder, VIDEO_CODEC_ENCODER_INTERFACE, &cfg, 0, VPX_ENCODER_ABI_VERSION) != VPX_CODEC_OK) { - fprintf(stderr, "Failed to initialize encoder\n"); + /*fprintf(stderr, "Failed to initialize encoder\n");*/ return -1; } diff --git a/toxav/msi.c b/toxav/msi.c index 7cc55de2..77ee1b38 100755 --- a/toxav/msi.c +++ b/toxav/msi.c @@ -729,7 +729,10 @@ void *handle_timeout ( void *arg ) { /* Send hangup either way */ MSISession *_session = arg; - + + if ( callbacks[MSI_OnRequestTimeout].function ) callbacks[MSI_OnRequestTimeout].function ( callbacks[MSI_OnRequestTimeout].data ); + if ( callbacks[MSI_OnEnding].function ) callbacks[MSI_OnEnding ].function ( callbacks[MSI_OnEnding].data ); + if ( _session && _session->call ) { uint32_t *_peers = _session->call->peers; @@ -744,9 +747,6 @@ void *handle_timeout ( void *arg ) } - if ( callbacks[MSI_OnRequestTimeout].function ) callbacks[MSI_OnRequestTimeout].function ( callbacks[MSI_OnRequestTimeout].data ); - if ( callbacks[MSI_OnEnding].function ) callbacks[MSI_OnEnding ].function ( callbacks[MSI_OnEnding].data ); - return NULL; } diff --git a/toxav/rtp.c b/toxav/rtp.c index ef5d0928..ea70ca74 100755 --- a/toxav/rtp.c +++ b/toxav/rtp.c @@ -751,7 +751,7 @@ int rtp_send_msg ( RTPSession *session, Messenger *messenger, const uint8_t *dat /*if ( full_length != sendpacket ( messenger->net, *((IP_Port*) &session->dest), _send_data, full_length) ) {*/ if ( full_length != send_custom_user_packet(messenger, session->dest, _send_data, full_length) ) { - fprintf(stderr, "Rtp error: %s\n", strerror(errno)); + /*fprintf(stderr, "Rtp error: %s\n", strerror(errno));*/ return -1; } @@ -823,7 +823,7 @@ RTPSession *rtp_init_session ( int payload_type, /*networking_registerhandler(messenger->net, payload_type, rtp_handle_packet, _retu);*/ if ( -1 == custom_user_packet_registerhandler(messenger, friend_num, payload_type, rtp_handle_packet, _retu) ) { - fprintf(stderr, "Error setting custom register handler for rtp session\n"); + /*fprintf(stderr, "Error setting custom register handler for rtp session\n");*/ free(_retu); return NULL; } -- cgit v1.2.3 From dbc4314bdaec4ca66f9b256a80866267d64c77e0 Mon Sep 17 00:00:00 2001 From: mannol Date: Wed, 12 Mar 2014 00:38:20 +0100 Subject: Invoke callback via invoke_callback func --- toxav/msi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/toxav/msi.c b/toxav/msi.c index 77ee1b38..4bae076f 100755 --- a/toxav/msi.c +++ b/toxav/msi.c @@ -729,10 +729,10 @@ void *handle_timeout ( void *arg ) { /* Send hangup either way */ MSISession *_session = arg; - - if ( callbacks[MSI_OnRequestTimeout].function ) callbacks[MSI_OnRequestTimeout].function ( callbacks[MSI_OnRequestTimeout].data ); - if ( callbacks[MSI_OnEnding].function ) callbacks[MSI_OnEnding ].function ( callbacks[MSI_OnEnding].data ); - + + invoke_callback(MSI_OnRequestTimeout); + invoke_callback(MSI_OnEnding); + if ( _session && _session->call ) { uint32_t *_peers = _session->call->peers; -- cgit v1.2.3