Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
IPTV: correct the check for simultaneous input streams, fixes #3723
  • Loading branch information
perexg committed Apr 15, 2016
1 parent 1c95a19 commit 2f71335
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/input/mpegts/iptv/iptv.c
Expand Up @@ -150,9 +150,9 @@ const idclass_t iptv_input_class = {
};

static int
iptv_input_is_free ( mpegts_input_t *mi, mpegts_mux_t *mm )
iptv_input_is_free ( mpegts_input_t *mi, mpegts_mux_t *mm, int active )
{
int c = 0;
int c = active;
mpegts_mux_instance_t *mmi;
iptv_network_t *in = (iptv_network_t *)mm->mm_network;

Expand Down Expand Up @@ -180,8 +180,8 @@ iptv_input_get_weight ( mpegts_input_t *mi, mpegts_mux_t *mm, int flags )
mpegts_mux_instance_t *mmi;

/* Find the "min" weight */
if (!iptv_input_is_free(mi, mm)) {
w = 1000000;
if (!iptv_input_is_free(mi, mm, 0)) {
w = INT_MAX;

/* Service subs */
pthread_mutex_lock(&mi->mi_output_lock);
Expand Down Expand Up @@ -228,10 +228,10 @@ iptv_input_warm_mux ( mpegts_input_t *mi, mpegts_mux_instance_t *mmi )
return 0;

/* Do we need to stop something? */
if (!iptv_input_is_free(mi, mmi->mmi_mux)) {
if (!iptv_input_is_free(mi, mmi->mmi_mux, 1)) {
pthread_mutex_lock(&mi->mi_output_lock);
mpegts_mux_instance_t *m, *s = NULL;
int w = 1000000;
int w = INT_MAX;
LIST_FOREACH(m, &mi->mi_mux_active, mmi_active_link) {
int t = mpegts_mux_instance_weight(m);
if (t < w) {
Expand Down

4 comments on commit 2f71335

@puithove
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but this commit breaks the max stream functionality. I have two IPTV networks each configured with a max streams = 3. As soon as I build with this commit, the startup scan when the server is started tries to scan all muxes from both networks all at once. This brings the server to a halt where the web UI is not responding.

When I build with up to 1c95a19, everything is fine.

@perexg
Copy link
Contributor Author

@perexg perexg commented on 2f71335 Apr 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you try to replace INT_MAX with 1000000 (in this commit) ?

@perexg
Copy link
Contributor Author

@perexg perexg commented on 2f71335 Apr 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't help probably. Give me '--trace mpegts,service' in a bug-report on tvheadend.org .

@puithove
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.