diff --git a/core/AmMediaProcessor.cpp b/core/AmMediaProcessor.cpp index a52129b8..b881d81d 100644 --- a/core/AmMediaProcessor.cpp +++ b/core/AmMediaProcessor.cpp @@ -395,6 +395,7 @@ void AmMediaProcessorThread::process(AmEvent* e) case AmMediaProcessor::InsertSession: DBG("Session inserted to the scheduler\n"); sessions.insert(sr->s); + sr->s->RTPStream()->clearRTPTimeout(); break; case AmMediaProcessor::RemoveSession:{ diff --git a/core/AmRtpStream.cpp b/core/AmRtpStream.cpp index 651d19ff..bb2b0a4f 100644 --- a/core/AmRtpStream.cpp +++ b/core/AmRtpStream.cpp @@ -678,6 +678,10 @@ void AmRtpStream::clearRTPTimeout(struct timeval* recv_time) { memcpy(&last_recv_time, recv_time, sizeof(struct timeval)); } +void AmRtpStream::clearRTPTimeout() { + gettimeofday(&last_recv_time,NULL); +} + unsigned int AmRtpStream::bytes2samples(unsigned int) const { ERROR("bytes2samples called on AmRtpStream\n"); return 0; diff --git a/core/AmRtpStream.h b/core/AmRtpStream.h index 497a6213..7e839e58 100644 --- a/core/AmRtpStream.h +++ b/core/AmRtpStream.h @@ -308,6 +308,11 @@ public: */ void clearRTPTimeout(struct timeval* recv_time); + /* + * clear RTP timeout to current time + */ + void clearRTPTimeout(); + virtual unsigned int bytes2samples(unsigned int) const; /** set relay stream for RTP relaying */