meetecho / janus-gateway

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

[1.x] Streaming plugin crashes when more than 12 videostreams (or 8 audio+video) streams #3225

Closed petarminchev closed 1 year ago

petarminchev commented 1 year ago

At line 9111 of streaming plugin in master there is currently: struct pollfd fds[50]; / FIXME We should make this dynamic /

Which means that if I use simulcast - that is 4 ports (3 layers + 1 RTCP) and 50 / 4 = max 12 supported streams. If I add more than 12 such video slots, then there is obviously a crash because of buffer overflow. Or if all slots are audio+video, then 50 / 6 = 8, and no more than 8 streams are supported.

Is it an easy fix to not hardcode that [50] array? Could you at least increase it to [100] or [200] so more streams are supported, if it is hard to make it dynamic?

Currently it is kind of a blocker for us, because we cannot predefine more than 8 (audio+video) slots.

lminiero commented 1 year ago

Yes, it should be made more dynamic. I'll think of a way to do this on the fly. For the time being, you may want to manually use a larger value there, if you need more sockets.