summaryrefslogtreecommitdiff
path: root/toxav/toxav.c
diff options
context:
space:
mode:
authormannol <eniz_vukovic@hotmail.com>2015-06-25 01:04:31 +0200
committermannol <eniz_vukovic@hotmail.com>2015-06-25 01:04:31 +0200
commit9aba4ec273b782fd34a869a902cc2a0b8275dbff (patch)
tree61a1a94883d62163e1931b318787aa96978e2295 /toxav/toxav.c
parentf9f17fdf10d6fa233ffc0dbf568afbbd4b1ef179 (diff)
Random fixes
Diffstat (limited to 'toxav/toxav.c')
-rw-r--r--toxav/toxav.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/toxav/toxav.c b/toxav/toxav.c
index 35523319..c7012cb4 100644
--- a/toxav/toxav.c
+++ b/toxav/toxav.c
@@ -331,7 +331,7 @@ void toxav_iterate(ToxAV* av)
331 av->dmsst += current_time_monotonic() - start; 331 av->dmsst += current_time_monotonic() - start;
332 332
333 if (++av->dmssc == 3) { 333 if (++av->dmssc == 3) {
334 av->dmssa = av->dmsst / 3 + 2 /* NOTE Magic Offset for precission */; 334 av->dmssa = av->dmsst / 3 + 5 /* NOTE Magic Offset for precission */;
335 av->dmssc = 0; 335 av->dmssc = 0;
336 av->dmsst = 0; 336 av->dmsst = 0;
337 } 337 }
@@ -1270,20 +1270,28 @@ bool call_prepare_transmission(ToxAVCall* call)
1270 1270
1271 { /* Prepare audio */ 1271 { /* Prepare audio */
1272 call->audio.second = ac_new(av, call->friend_number, av->acb.first, av->acb.second); 1272 call->audio.second = ac_new(av, call->friend_number, av->acb.first, av->acb.second);
1273 call->audio.first = rtp_new(rtp_TypeAudio, av->m, call->friend_number, call->audio.second, ac_queue_message); 1273 if (!call->audio.second) {
1274 LOGGER_ERROR("Failed to create audio codec session");
1275 goto FAILURE;
1276 }
1274 1277
1275 if ( !call->audio.first || !call->audio.second ) { 1278 call->audio.first = rtp_new(rtp_TypeAudio, av->m, call->friend_number, call->audio.second, ac_queue_message);
1276 LOGGER_ERROR("Error while starting audio!\n"); 1279 if (!call->audio.first) {
1280 LOGGER_ERROR("Failed to create audio rtp session");;
1277 goto FAILURE; 1281 goto FAILURE;
1278 } 1282 }
1279 } 1283 }
1280 1284
1281 { /* Prepare video */ 1285 { /* Prepare video */
1282 call->video.second = vc_new(av, call->friend_number, av->vcb.first, av->vcb.second, call->msi_call->peer_vfpsz); 1286 call->video.second = vc_new(av, call->friend_number, av->vcb.first, av->vcb.second, call->msi_call->peer_vfpsz);
1283 call->video.first = rtp_new(rtp_TypeVideo, av->m, call->friend_number, call->video.second, vc_queue_message); 1287 if (!call->video.second) {
1288 LOGGER_ERROR("Failed to create video codec session");
1289 goto FAILURE;
1290 }
1284 1291
1285 if ( !call->video.first || !call->video.second ) { 1292 call->video.first = rtp_new(rtp_TypeVideo, av->m, call->friend_number, call->video.second, vc_queue_message);
1286 LOGGER_ERROR("Error while starting video!\n"); 1293 if (!call->video.first) {
1294 LOGGER_ERROR("Failed to create video rtp session");
1287 goto FAILURE; 1295 goto FAILURE;
1288 } 1296 }
1289 } 1297 }