Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
IPTV: try to resolve stream counting / bandwidth managing, fixes #3729
  • Loading branch information
perexg committed Apr 18, 2016
1 parent b41af43 commit 3d4ac3e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/input/mpegts/iptv/iptv.c
Expand Up @@ -171,6 +171,13 @@ iptv_input_is_free ( mpegts_input_t *mi, mpegts_mux_t *mm, int active )
return 1;
}

static int
iptv_input_is_enabled
( mpegts_input_t *mi, mpegts_mux_t *mm, int flags, int weight )
{
return iptv_input_is_free(mi, mm, 0);
}

static int
iptv_input_get_weight ( mpegts_input_t *mi, mpegts_mux_t *mm, int flags )
{
Expand All @@ -190,6 +197,9 @@ iptv_input_get_weight ( mpegts_input_t *mi, mpegts_mux_t *mm, int flags )
LIST_FOREACH(ths, &s->s_subscriptions, ths_service_link)
w = MIN(w, ths->ths_weight);
pthread_mutex_unlock(&mi->mi_output_lock);

if (w == INT_MAX)
w = 0;
}

return w;
Expand Down Expand Up @@ -1056,6 +1066,7 @@ void iptv_init ( void )
iptv_input->mi_warm_mux = iptv_input_warm_mux;
iptv_input->mi_start_mux = iptv_input_start_mux;
iptv_input->mi_stop_mux = iptv_input_stop_mux;
iptv_input->mi_is_enabled = iptv_input_is_enabled;
iptv_input->mi_get_weight = iptv_input_get_weight;
iptv_input->mi_get_grace = iptv_input_get_grace;
iptv_input->mi_get_priority = iptv_input_get_priority;
Expand Down

0 comments on commit 3d4ac3e

Please sign in to comment.