comparison libpurple/media/media.c @ 29560:18571ea6e44a

Store remote_candidates in PurpleMedia as a GList of PurpleMediaCandidate's.
author maiku@pidgin.im
date Mon, 26 Oct 2009 18:45:30 +0000
parents cb843608e183
children 7713312c4ab0
comparison
equal deleted inserted replaced
29559:cb843608e183 29560:18571ea6e44a
323 g_free(stream->participant); 323 g_free(stream->participant);
324 324
325 if (stream->local_candidates) 325 if (stream->local_candidates)
326 purple_media_candidate_list_free(stream->local_candidates); 326 purple_media_candidate_list_free(stream->local_candidates);
327 if (stream->remote_candidates) 327 if (stream->remote_candidates)
328 fs_candidate_list_destroy(stream->remote_candidates); 328 purple_media_candidate_list_free(stream->remote_candidates);
329 329
330 if (stream->active_local_candidates) 330 if (stream->active_local_candidates)
331 fs_candidate_list_destroy(stream->active_local_candidates); 331 fs_candidate_list_destroy(stream->active_local_candidates);
332 if (stream->active_remote_candidates) 332 if (stream->active_remote_candidates)
333 fs_candidate_list_destroy(stream->active_remote_candidates); 333 fs_candidate_list_destroy(stream->active_remote_candidates);
1115 stream->session->type), NULL); 1115 stream->session->type), NULL);
1116 stream->accepted = TRUE; 1116 stream->accepted = TRUE;
1117 1117
1118 if (stream->remote_candidates != NULL) { 1118 if (stream->remote_candidates != NULL) {
1119 GError *err = NULL; 1119 GError *err = NULL;
1120 GList *candidates;
1121
1122 candidates = purple_media_candidate_list_to_fs(
1123 stream->remote_candidates);
1120 fs_stream_set_remote_candidates(stream->stream, 1124 fs_stream_set_remote_candidates(stream->stream,
1121 stream->remote_candidates, &err); 1125 candidates, &err);
1126 fs_candidate_list_destroy(candidates);
1122 1127
1123 if (err) { 1128 if (err) {
1124 purple_debug_error("media", "Error adding remote" 1129 purple_debug_error("media", "Error adding remote"
1125 " candidates: %s\n", err->message); 1130 " candidates: %s\n", err->message);
1126 g_error_free(err); 1131 g_error_free(err);
1678 participant ? participant : "(null)"); 1683 participant ? participant : "(null)");
1679 return; 1684 return;
1680 } 1685 }
1681 1686
1682 stream->remote_candidates = g_list_concat(stream->remote_candidates, 1687 stream->remote_candidates = g_list_concat(stream->remote_candidates,
1683 purple_media_candidate_list_to_fs(remote_candidates)); 1688 purple_media_candidate_list_copy(remote_candidates));
1684 1689
1685 if (stream->accepted == TRUE) { 1690 if (stream->accepted == TRUE) {
1691 GList *candidates = purple_media_candidate_list_to_fs(
1692 stream->remote_candidates);
1686 fs_stream_set_remote_candidates(stream->stream, 1693 fs_stream_set_remote_candidates(stream->stream,
1687 stream->remote_candidates, &err); 1694 candidates, &err);
1695 fs_candidate_list_destroy(candidates);
1688 1696
1689 if (err) { 1697 if (err) {
1690 purple_debug_error("media", "Error adding remote" 1698 purple_debug_error("media", "Error adding remote"
1691 " candidates: %s\n", err->message); 1699 " candidates: %s\n", err->message);
1692 g_error_free(err); 1700 g_error_free(err);