Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
epg: do not subscribe to muxes without any active (assigned) channels
  • Loading branch information
perexg committed Jun 27, 2014
1 parent 9e69054 commit fd0d993
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/epggrab/otamux.c
Expand Up @@ -124,9 +124,8 @@ epggrab_ota_done ( epggrab_ota_mux_t *ota, int timeout )
epggrab_ota_pending_timer_cb(NULL);

/* Remove from active */
if (!timeout) {
if (!timeout)
epggrab_ota_active_timer_cb(NULL);
}
}

static void
Expand Down Expand Up @@ -339,7 +338,8 @@ epggrab_ota_pending_timer_cb ( void *p )
}

/* Subscribe to the mux */
if (mpegts_mux_subscribe(mm, "epggrab", SUBSCRIPTION_PRIO_EPG)) {
if (mm->mm_is_epg(mm) <= 0 ||
mpegts_mux_subscribe(mm, "epggrab", SUBSCRIPTION_PRIO_EPG)) {
om->om_active = 0;
om->om_when = dispatch_clock + epggrab_ota_period(om, 4) + extra;
LIST_INSERT_SORTED(&epggrab_ota_pending, om, om_q_link, om_time_cmp);
Expand Down
1 change: 1 addition & 0 deletions src/input/mpegts.h
Expand Up @@ -377,6 +377,7 @@ struct mpegts_mux
void (*mm_open_table) (mpegts_mux_t*,mpegts_table_t*,int subscribe);
void (*mm_close_table) (mpegts_mux_t*,mpegts_table_t*);
void (*mm_create_instances) (mpegts_mux_t*);
int (*mm_is_epg) (mpegts_mux_t*);

/*
* Configuration
Expand Down
15 changes: 15 additions & 0 deletions src/input/mpegts/mpegts_mux.c
Expand Up @@ -439,6 +439,20 @@ mpegts_mux_is_enabled ( mpegts_mux_t *mm )
return mm->mm_enabled;
}

static int
mpegts_mux_is_epg ( mpegts_mux_t *mm )

This comment has been minimized.

Copy link
@adamsutton

adamsutton Jun 28, 2014

Contributor

This is not right, many systems (like SKY UK), have muxes whose primary purpose is to provide EPG (and other) data services, they have no useful services that would be mapped to channels.

With this commit my EPG will disappear.

{
mpegts_service_t *s;

lock_assert(&global_lock);

LIST_FOREACH(s, &mm->mm_services, s_dvb_mux_link)
if (LIST_FIRST(&s->s_channels))
break;

return s ? 1 : 0;
}

static void
mpegts_mux_create_instances ( mpegts_mux_t *mm )
{
Expand Down Expand Up @@ -833,6 +847,7 @@ mpegts_mux_create0
mm->mm_display_name = mpegts_mux_display_name;
mm->mm_config_save = mpegts_mux_config_save;
mm->mm_is_enabled = mpegts_mux_is_enabled;
mm->mm_is_epg = mpegts_mux_is_epg;

/* Start/stop */
mm->mm_start = mpegts_mux_start;
Expand Down

0 comments on commit fd0d993

Please sign in to comment.