synstreamoff.c
来自「linux环境下用纯c写的RTP协议的通用开发库」· C语言 代码 · 共 46 行
C
46 行
/*------------------------------------------------------------------------- * synstreamoff.c - synstreamoff *------------------------------------------------------------------------- */#include <rtp.h>#include <syn.h>/*------------------------------------------------------------------------ * synstreamoff - turn off a stream at the synchronization layer and mark * it for removal. Unlike at the RTP layer, it is not necessary to hold * state for streams that the application is not interested in receiving. *------------------------------------------------------------------------ */intsynstreamoff(struct synsession *pssn, ssrc_t ssrc){ struct synstream *psstm; struct session *psn; psn = pssn->ssn_session; psstm = syngetstream(pssn, ssrc); if (psstm == NULL) return ERROR; /* * Turn off the stream at the RTP layer. */ rtpstreamoff(psn, ssrc); /* * The following code handles the case where a thread is * still in synread. The stream is marked as a zombie, * the reader is signaled. */ pthread_mutex_lock(&psstm->sstm_readmutex); psstm->sstm_zombie = TRUE; pthread_cond_broadcast(&psstm->sstm_readcond); pthread_mutex_unlock(&psstm->sstm_readmutex); synreleasestream(pssn, psstm); return OK;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?