Fixed bug when adjusting queue size

This commit is contained in:
mannol 2014-06-20 00:23:05 +02:00
parent 9b2d3e50b2
commit 88a131a2e8

View File

@ -603,10 +603,11 @@ int rtp_release_session_recv ( RTPSession *session )
*/
void rtp_queue_adjust_limit(RTPSession *session, uint64_t limit)
{
RTPMessage *_tmp, * _it;
pthread_mutex_lock(&session->mutex);
RTPMessage *_tmp, * _it = session->oldest_msg;
for ( _it = session->oldest_msg; session->queue_size > limit; _it = _tmp ) {
for ( ; session->queue_size > limit; _it = _tmp ) {
_tmp = _it->next;
rtp_free_msg( session, _it);
session->queue_size --;