meetecho / janus-gateway

Janus WebRTC Server
https://janus.conf.meetecho.com
GNU General Public License v3.0
8.25k stars 2.48k forks source link

janus_streaming: remove always false branch #3096

Closed tmatth closed 2 years ago

tmatth commented 2 years ago

No functional change, this is just for clarity.

Since every branch of the previous if (session->mountpoint != NULL) conditional terminates in either goto error or goto done, there is no case where session->mountpoint will be non-null when arriving at this check.

tmatth commented 2 years ago

For context we are trying to debug what seems to be a deadlock in the streaming plugin API that at some point in the sequence logs an Already watching a stream... error.

I was going to add more detail to in order to distinguish if the error was that session->mountpoint was NULL vs. the session was found in the list mp->viewers when I realized that it could only ever be the latter case.

lminiero commented 2 years ago

Yep, good catch: initially I was wondering why you thought the session->mountpoint check was unneeded, and then realized it was in "watch" and after checking if this was for a renegotiation.

lminiero commented 2 years ago

Merging :+1: