Commit 61529b8d authored by Jean-Paul Saman's avatar Jean-Paul Saman
Browse files

Fixed long problem with tuning to frequencies like; 12669500 Hz which is not...

Fixed long problem with tuning to frequencies like; 12669500 Hz which is not possible with the old satellite plugin, because it reads 12669,5 in kHz and could not be expressed.
* Frequency, symbol rate, LNB_LOF1, LNB_LOF2 and LNB_SLOF are in Hz now. Input methods "dvb", "qpsk", "cable", "terrestrial" use this policy.
* Added backwards compatibility with access method "satellite" as used by the GUI; frequency and symbol rate are interpreted as kHz.
parent 51c3cea1
......@@ -143,10 +143,10 @@ int E_(Open) ( vlc_object_t *p_this )
else if (strncmp( p_input->psz_access, "terrestrial",11) ==0)
frontend_info.type = FE_OFDM;
frontend_info.frequency_max = 12999 * 1000;
frontend_info.frequency_min = 9750 * 1000;
frontend_info.symbol_rate_max = 30000 * 1000;
frontend_info.symbol_rate_min = 1000 * 1000;
frontend_info.frequency_max = 12999000;
frontend_info.frequency_min = 9750000;
frontend_info.symbol_rate_max = 30000000;
frontend_info.symbol_rate_min = 1000000;
}
/* Register Callback functions */
......@@ -172,14 +172,19 @@ int E_(Open) ( vlc_object_t *p_this )
}
}
/* Workaround for backwards compatibility */
if (strncmp( p_input->psz_access, "satellite",9 ) ==0)
{
msg_Warn( p_input, "invalid frequency %d possibly in kHz, trying value *1000 Hz", u_freq );
u_freq *= 1000;
}
/* Validating input values */
u_freq *= 1000;
if ( ((u_freq) > frontend_info.frequency_max) ||
((u_freq) < frontend_info.frequency_min) )
{
msg_Warn( p_input, "invalid frequency %d (kHz), using default one", u_freq );
msg_Warn( p_input, "invalid frequency %d (Hz), using default one", u_freq );
u_freq = config_GetInt( p_input, "frequency" );
u_freq *= 1000;
if ( ((u_freq) > frontend_info.frequency_max) ||
((u_freq) < frontend_info.frequency_min) )
{
......@@ -188,13 +193,18 @@ int E_(Open) ( vlc_object_t *p_this )
}
}
u_srate *= 1000;
/* Workaround for backwards compatibility */
if (strncmp( p_input->psz_access, "satellite", 9 ) ==0)
{
msg_Warn( p_input, "invalid symbol rate %d possibly specified in kHz, trying value *1000 Hz", u_freq );
u_srate *= 1000;
}
if ( ((u_srate) > frontend_info.symbol_rate_max) ||
((u_srate) < frontend_info.symbol_rate_min) )
{
msg_Warn( p_input, "invalid symbol rate, using default one" );
u_srate = config_GetInt( p_input, "symbol-rate" );
u_srate *= 1000;
if ( ((u_srate) > frontend_info.symbol_rate_max) ||
((u_srate) < frontend_info.symbol_rate_min) )
{
......@@ -227,9 +237,9 @@ int E_(Open) ( vlc_object_t *p_this )
/* Get antenna configuration options */
b_diseqc = config_GetInt( p_input, "diseqc" );
u_lnb_lof1 = config_GetInt( p_input, "lnb-lof1" ) * 1000;
u_lnb_lof2 = config_GetInt( p_input, "lnb-lof2" ) * 1000;
u_lnb_slof = config_GetInt( p_input, "lnb-slof" ) * 1000;
u_lnb_lof1 = config_GetInt( p_input, "lnb-lof1" );
u_lnb_lof2 = config_GetInt( p_input, "lnb-lof2" );
u_lnb_slof = config_GetInt( p_input, "lnb-slof" );
/* Setting frontend parameters for tuning the hardware */
switch( frontend_info.type )
......@@ -528,7 +538,7 @@ int SatelliteSetProgram( input_thread_t * p_input,
default:
ioctl_SetDMXFilter(p_input, p_es->i_id, &p_es->i_demux_fd, 21, u_adapter, u_device);
input_SelectES( p_input , p_es );
msg_Dbg(p_input, "Warning ES streamtype 0x%d found used as DMX_PES_OTHER !!",(int) p_es->i_cat);
msg_Warn(p_input, "ES streamtype 0x%d found used as DMX_PES_OTHER !!",(int) p_es->i_cat);
break;
#undef p_es
}
......
......@@ -47,7 +47,7 @@ void E_(Close) ( vlc_object_t * );
#define DEVICE_TEXT N_("device nummer to use on adapter")
#define DEVICE_LONGTEXT ""
#define FREQ_TEXT N_("satellite default transponder frequency")
#define FREQ_TEXT N_("satellite default transponder frequency in Hz")
#define FREQ_LONGTEXT ""
#define POL_TEXT N_("satellite default transponder polarization")
......@@ -56,19 +56,19 @@ void E_(Close) ( vlc_object_t * );
#define FEC_TEXT N_("satellite default transponder FEC")
#define FEC_LONGTEXT N_("FEC=Forward Error Correction mode")
#define SRATE_TEXT N_("satellite default transponder symbol rate")
#define SRATE_TEXT N_("satellite default transponder symbol rate in Hz")
#define SRATE_LONGTEXT ""
#define DISEQC_TEXT N_("use diseqc with antenna")
#define DISEQC_LONGTEXT ""
#define LNB_LOF1_TEXT N_("antenna lnb_lof1 (kHz)")
#define LNB_LOF1_TEXT N_("antenna lnb_lof1 (Hz)")
#define LNB_LOF1_LONGTEXT ""
#define LNB_LOF2_TEXT N_("antenna lnb_lof2 (kHz)")
#define LNB_LOF2_TEXT N_("antenna lnb_lof2 (Hz)")
#define LNB_LOF2_LONGTEXT ""
#define LNB_SLOF_TEXT N_("antenna lnb_slof (kHz)")
#define LNB_SLOF_TEXT N_("antenna lnb_slof (Hz)")
#define LNB_SLOF_LONGTEXT ""
#define PROBE_TEXT N_("probe the dvb card for capabilities (default disabled)")
......@@ -101,14 +101,14 @@ vlc_module_begin();
add_category_hint( N_("Input"), NULL, VLC_FALSE );
add_integer( "adapter", 0, NULL, ADAPTER_TEXT, ADAPTER_LONGTEXT, VLC_FALSE );
add_integer( "device", 0, NULL, DEVICE_TEXT, DEVICE_LONGTEXT, VLC_FALSE );
add_integer( "frequency", 11954, NULL, FREQ_TEXT, FREQ_LONGTEXT, VLC_FALSE );
add_integer( "frequency", 11954000, NULL, FREQ_TEXT, FREQ_LONGTEXT, VLC_FALSE );
add_integer( "polarization", 0, NULL, POL_TEXT, POL_LONGTEXT, VLC_FALSE );
add_integer( "fec", 3, NULL, FEC_TEXT, FEC_LONGTEXT, VLC_FALSE );
add_integer( "symbol-rate", 27500, NULL, SRATE_TEXT, SRATE_LONGTEXT, VLC_FALSE );
add_integer( "symbol-rate", 27500000, NULL, SRATE_TEXT, SRATE_LONGTEXT, VLC_FALSE );
add_bool( "diseqc", 0, NULL, DISEQC_TEXT, DISEQC_LONGTEXT, VLC_FALSE );
add_integer( "lnb-lof1", 9750, NULL, LNB_LOF1_TEXT, LNB_LOF1_LONGTEXT, VLC_FALSE );
add_integer( "lnb-lof2", 10600, NULL, LNB_LOF2_TEXT, LNB_LOF2_LONGTEXT, VLC_FALSE );
add_integer( "lnb-slof", 11700, NULL, LNB_SLOF_TEXT, LNB_SLOF_LONGTEXT, VLC_FALSE );
add_integer( "lnb-lof1", 9750000, NULL, LNB_LOF1_TEXT, LNB_LOF1_LONGTEXT, VLC_FALSE );
add_integer( "lnb-lof2", 10600000, NULL, LNB_LOF2_TEXT, LNB_LOF2_LONGTEXT, VLC_FALSE );
add_integer( "lnb-slof", 11700000, NULL, LNB_SLOF_TEXT, LNB_SLOF_LONGTEXT, VLC_FALSE );
add_bool( "probe", 0, NULL, PROBE_TEXT, PROBE_LONGTEXT, VLC_FALSE );
add_integer( "code-rate-hp", 9, NULL, CODE_RATE_HP_TEXT, CODE_RATE_HP_LONGTEXT, VLC_FALSE );
add_integer( "code-rate-lp", 9, NULL, CODE_RATE_LP_TEXT, CODE_RATE_LP_LONGTEXT, VLC_FALSE );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment