hust_rtpreleasestream.c

来自「实现基于ip2022的MPEG2 TS的IP组播接收」· C语言 代码 · 共 55 行

C
55
字号
/*------------------------------------------------------------------------- * rtpreleasestream.c - rtpreleasestream *------------------------------------------------------------------------- */#include "ipOS.h"#include "ipHAL.h"#include "hust_rtp.h"#include "hust_rtcp.h"#include "hust_hash.h"/*------------------------------------------------------------------------ * rtpreleasestream - decrement a streams refcnt and remove if necessary *------------------------------------------------------------------------ */intrtpreleasestream(struct session *psn, struct stream *pstm){	///if (pthread_mutex_lock(&psn->sn_getstreammutex) != 0)		///return ERROR;	pstm->stm_refcnt--;  	if (pstm->stm_refcnt == 0 && pstm->stm_zombie == TRUE) {		/*		 * Remove this stream from the Cname->SSRC mapping.		 */		rtcpcnamerem(psn, pstm);		if (pstm->stm_name != NULL)			heap_free(pstm->stm_name);		if (pstm->stm_email != NULL)			heap_free(pstm->stm_email);		if (pstm->stm_phone != NULL)			heap_free(pstm->stm_phone);		if (pstm->stm_loc != NULL)			heap_free(pstm->stm_loc);		if (pstm->stm_tool != NULL)			heap_free(pstm->stm_tool);		if (pstm->stm_note != NULL)			heap_free(pstm->stm_note);		if (pstm->stm_priv != NULL)			heap_free(pstm->stm_priv);		/*		 * Remove this stream from the SSRC->struct stream *		 * hashtable. The htdel function will invoke		 * rtpdestroystream.		 */		htdel(psn->sn_ssrcs, pstm->stm_ssrc);	}	////pthread_mutex_unlock(&psn->sn_getstreammutex);	return ;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?