?? hust_rtpsources.c
字號:
/*------------------------------------------------------------------------- * rtpsources.c - rtpsources *------------------------------------------------------------------------- *//////#include <stdlib.h>#include "hust_rtp.h"#include "hust_hash.h"/*------------------------------------------------------------------------- * rtpsources - fill array sources with a list of synchronization sources * participating in the session and return list's length. * Maxsources gives the size of the area pointed to by sources in * sizeof(ssrc_t) (short) units. *------------------------------------------------------------------------- */intrtpsources(struct session *psn, ssrc_t *sources, u16_t maxsources){ struct htent **v; int htcount, i, count; ///if (pthread_mutex_lock(&psn->sn_getstreammutex) != 0) ///return ERROR; if ((v = htenum(psn->sn_ssrcs)) == NULL) { ////pthread_mutex_unlock(&psn->sn_getstreammutex); return ERROR; } ////正確獲得一個會話中所有的同步源 for (htcount = 0; v[htcount] != NULL; htcount++); maxsources = min(maxsources, htcount); ///數組的大小不能大于maxsources,否則溢出 for (i = 0, count = 0; count < maxsources && i < htcount; i++) if (((struct stream *) v[i]->hte_object)->stm_zombie != TRUE) { sources[i] = v[i]->hte_key; count++; } ///sources中放的是哈希表的key ////pthread_mutex_unlock(&psn->sn_getstreammutex); ///free(v); return maxsources;}/////把一個會話中的所有的同步源的key放到一個數組中/////并返回數組的大小
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -