Skip to content

Commit

Permalink
fix muting of new sessions when status arrived before first RTP
Browse files Browse the repository at this point in the history
  • Loading branch information
ka9q committed May 6, 2024
1 parent 7ab69bc commit 8b2dff1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ static void *statproc(void *arg){
continue;
}
sp->ssrc = ssrc;
sp->init = false; // Wait for first RTP packet to set the rest up
}
memcpy(&sp->sender,&sender,sizeof(sp->sender));
sp->last_active = gps_time_ns(); // Keep active time calc from blowing up before data packet arrives
Expand Down Expand Up @@ -657,6 +658,8 @@ static void *dataproc(void *arg){
memcpy(&sp->sender,&sender,sizeof(sender)); // Bind to specific host and sending port
pthread_mutex_unlock(&Sess_mutex);

}
if(!sp->init){
// status reception doesn't write below this point
char const *id = lookupid(pkt->rtp.ssrc);
if(id)
Expand All @@ -672,6 +675,7 @@ static void *dataproc(void *arg){
sp->last_timestamp = pkt->rtp.timestamp;
sp->rtp_state.seq = pkt->rtp.seq;
sp->reset = true;
sp->init = true;

if(pthread_create(&sp->task,NULL,decode_task,sp) == -1){
perror("pthread_create");
Expand Down

0 comments on commit 8b2dff1

Please sign in to comment.