]> git.ipfire.org Git - thirdparty/tvheadend.git/commit
iptv: Fix stream limit starting a new input on a running mux
authorMichael Marley <michael@michaelmarley.com>
Sun, 12 Dec 2021 02:01:08 +0000 (21:01 -0500)
committerFlole998 <Flole998@users.noreply.github.com>
Sun, 12 Dec 2021 22:10:21 +0000 (23:10 +0100)
commit09a2c71abb01db8735437f233b8a54a0bb4939fc
tree0ce042d01b1b66b9205bd2db78401dc9f32e6284
parent6f3b31043d89324c6b406286c1561ca0a213ba48
iptv: Fix stream limit starting a new input on a running mux

In iptv.c:iptv_input_is_free(), if all the conf arguments are 0
(when called from input_is_enabled()), return null if the mux
associated with the input is already running.  If the mux is
already running, starting a new input on it isn't going to create
a new input stream or break any bandwidth limit.  This fixes an
issue where starting a new channel/input on a mux that is already
active when the maximum number of input streams are in use would
result in failure.

This function is rather dense and appears to perform multiple
different functions depending on who called it, so I had a hard
time understanding exactly what is going on.  Therefore, I made
this patch in a way to be sure that it wouldn't affect how it works
in other cases than input_is_enabled().  If there is a better way
to do this, please do tell me.
src/input/mpegts/iptv/iptv.c