Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
linuxdvb: Do not allow to use tuner in the setup phase (diseqc+)
  • Loading branch information
perexg committed Aug 17, 2014
1 parent f14d7be commit 68232b6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/input/mpegts/linuxdvb/linuxdvb_frontend.c
Expand Up @@ -261,6 +261,7 @@ linuxdvb_frontend_is_enabled ( mpegts_input_t *mi, mpegts_mux_t *mm,
if (lfe->lfe_fe_path == NULL) return 0;
if (!mpegts_input_is_enabled(mi, mm, reason)) return 0;
if (access(lfe->lfe_fe_path, R_OK | W_OK)) return 0;
if (lfe->lfe_in_setup) return 0;
return 1;
}

Expand Down Expand Up @@ -288,6 +289,7 @@ linuxdvb_frontend_stop_mux
lfe->lfe_ready = 0;
lfe->lfe_locked = 0;
lfe->lfe_status = 0;
assert(lfe->lfe_in_setup == 0);

/* Ensure it won't happen immediately */
gtimer_arm(&lfe->lfe_monitor_timer, linuxdvb_frontend_monitor, lfe, 2);
Expand All @@ -301,6 +303,8 @@ linuxdvb_frontend_start_mux
( mpegts_input_t *mi, mpegts_mux_instance_t *mmi )
{
linuxdvb_frontend_t *lfe = (linuxdvb_frontend_t*)mi;
lfe->lfe_in_setup = 1;
lfe->lfe_ioctls = 0;
if (lfe->lfe_satconf)
return linuxdvb_satconf_start_mux(lfe->lfe_satconf, mmi);
return linuxdvb_frontend_tune1((linuxdvb_frontend_t*)mi, mmi, -1);
Expand Down Expand Up @@ -1061,7 +1065,6 @@ linuxdvb_frontend_tune0
}
lfe->lfe_locked = 0;
lfe->lfe_status = 0;
lfe->lfe_ioctls = 0;

/*
* copy the universal parameters to the Linux kernel structure
Expand Down Expand Up @@ -1245,6 +1248,8 @@ linuxdvb_frontend_tune1
gtimer_arm_ms(&lfe->lfe_monitor_timer, linuxdvb_frontend_monitor, lfe, 50);
lfe->lfe_ready = 1;
}

lfe->lfe_in_setup = 0;

return r;
}
Expand Down
1 change: 1 addition & 0 deletions src/input/mpegts/linuxdvb/linuxdvb_private.h
Expand Up @@ -99,6 +99,7 @@ struct linuxdvb_frontend
* Tuning
*/
int lfe_ready;
int lfe_in_setup;
int lfe_locked;
int lfe_status;
int lfe_ioctls;
Expand Down

0 comments on commit 68232b6

Please sign in to comment.