Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
linuxdvb: notify user that tuners with same types cannot be used simu…
…ltaneously when they're assigned to one adapter
  • Loading branch information
perexg committed Apr 12, 2015
1 parent 14f03b8 commit 6751ade
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/input/mpegts/linuxdvb/linuxdvb_adapter.c
Expand Up @@ -235,8 +235,9 @@ linuxdvb_adapter_add ( const char *path )
dvb_fe_type_t type;
#if DVB_VER_ATLEAST(5,5)
int delsys;
dvb_fe_type_t fetypes[DVB_TYPE_LAST+1] = { 0 };
dvb_fe_type_t fetypes[DVB_TYPE_LAST+1];
struct dtv_property cmd;
linuxdvb_frontend_t *lfe;
#endif

/* Validate the path */
Expand Down Expand Up @@ -331,6 +332,7 @@ linuxdvb_adapter_add ( const char *path )
/* Create frontend */
linuxdvb_frontend_create(feconf, la, i, fe_path, dmx_path, dvr_path, type, dfi.name);
#if DVB_VER_ATLEAST(5,5)
memset(fetypes, 0, sizeof(fetypes));
fetypes[type] = 1;
for (j = 0; j < cmd.u.buffer.len; j++) {
delsys = cmd.u.buffer.data[j];
Expand Down Expand Up @@ -362,6 +364,17 @@ linuxdvb_adapter_add ( const char *path )
/* Relock before exit */
pthread_mutex_lock(&global_lock);

#if DVB_VER_ATLEAST(5,5)
memset(fetypes, 0, sizeof(fetypes));
LIST_FOREACH(lfe, &la->la_frontends, lfe_link)
fetypes[lfe->lfe_type]++;
for (i = 0; i < ARRAY_SIZE(fetypes); i++)
if (fetypes[i] > 1)
tvhwarn("linuxdvb", "adapter %d has multiple tuners %d for type %s, "
"only one can be used at a time",
a, fetypes[i], dvb_type2str(i));
#endif

/* Save configuration */
if (save && la)
linuxdvb_adapter_save(la);
Expand Down

0 comments on commit 6751ade

Please sign in to comment.