+/*****************************************************************************
+ * FrontendSetATSC : controls the FE device
+ *****************************************************************************/
+static int FrontendSetATSC( access_t *p_access )
+{
+ access_sys_t *p_sys = p_access->p_sys;
+ struct dvb_frontend_parameters fep;
+ vlc_value_t val;
+ int i_ret;
+
+ /* Prepare the fep structure */
+
+ var_Get( p_access, "dvb-frequency", &val );
+ fep.frequency = val.i_int;
+
+ fep.u.vsb.modulation = DecodeModulationATSC( p_access );
+
+ /* Empty the event queue */
+ for( ; ; )
+ {
+ struct dvb_frontend_event event;
+ if ( ioctl( p_sys->i_frontend_handle, FE_GET_EVENT, &event ) < 0
+ && errno == EWOULDBLOCK )
+ break;
+ }
+
+ /* Now send it all to the frontend device */
+ if( (i_ret = ioctl( p_sys->i_frontend_handle, FE_SET_FRONTEND, &fep )) < 0 )
+ {
+ msg_Err( p_access, "ATSC: setting frontend failed (%d) %s", i_ret,
+ strerror(errno) );
+ return VLC_EGENERIC;
+ }
+
+ return VLC_SUCCESS;
+}
+