Commit 41bea401 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

DVB: don't bother printing ioctl() error return value

It's pretty much always -1.
parent b05360d2
...@@ -185,7 +185,7 @@ int FrontendOpen( access_t *p_access ) ...@@ -185,7 +185,7 @@ int FrontendOpen( access_t *p_access )
if( psz_expected != NULL ) if( psz_expected != NULL )
{ {
msg_Err( p_access, "the user asked for %s, and the tuner is %s", msg_Err( p_access, "requested type %s not supported by %s tuner",
psz_expected, psz_real ); psz_expected, psz_real );
close( p_sys->i_frontend_handle ); close( p_sys->i_frontend_handle );
free( p_frontend ); free( p_frontend );
...@@ -242,42 +242,42 @@ int FrontendSet( access_t *p_access ) ...@@ -242,42 +242,42 @@ int FrontendSet( access_t *p_access )
{ {
/* DVB-S */ /* DVB-S */
case FE_QPSK: case FE_QPSK:
if( FrontendSetQPSK( p_access ) < 0 ) if( FrontendSetQPSK( p_access ) )
{ {
msg_Err( p_access, "DVB-S: tuning failed" ); msg_Err( p_access, "DVB-S tuning error" );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
break; break;
/* DVB-C */ /* DVB-C */
case FE_QAM: case FE_QAM:
if( FrontendSetQAM( p_access ) < 0 ) if( FrontendSetQAM( p_access ) )
{ {
msg_Err( p_access, "DVB-C: tuning failed" ); msg_Err( p_access, "DVB-C tuning error" );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
break; break;
/* DVB-T */ /* DVB-T */
case FE_OFDM: case FE_OFDM:
if( FrontendSetOFDM( p_access ) < 0 ) if( FrontendSetOFDM( p_access ) )
{ {
msg_Err( p_access, "DVB-T: tuning failed" ); msg_Err( p_access, "DVB-T tuning error" );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
break; break;
/* ATSC */ /* ATSC */
case FE_ATSC: case FE_ATSC:
if( FrontendSetATSC( p_access ) < 0 ) if( FrontendSetATSC( p_access ) )
{ {
msg_Err( p_access, "ATSC: tuning failed" ); msg_Err( p_access, "ATSC tuning error" );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
break; break;
default: default:
msg_Err( p_access, "Could not determine frontend type on %s", msg_Err( p_access, "tuner type %s not supported",
p_sys->p_frontend->info.name ); p_sys->p_frontend->info.name );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -298,15 +298,10 @@ void FrontendPoll( access_t *p_access ) ...@@ -298,15 +298,10 @@ void FrontendPoll( access_t *p_access )
for( ;; ) for( ;; )
{ {
int i_ret = ioctl( p_sys->i_frontend_handle, FE_GET_EVENT, &event ); if( ioctl( p_sys->i_frontend_handle, FE_GET_EVENT, &event ) < 0 )
if( i_ret < 0 )
{ {
if( errno == EWOULDBLOCK ) if( errno != EWOULDBLOCK )
return; /* no more events */ msg_Err( p_access, "frontend event error: %m" );
msg_Err( p_access, "reading frontend event failed (%d): %m",
i_ret );
return; return;
} }
...@@ -478,7 +473,7 @@ int FrontendGetScanParameter( access_t *p_access, scan_parameter_t *p_scan ) ...@@ -478,7 +473,7 @@ int FrontendGetScanParameter( access_t *p_access, scan_parameter_t *p_scan )
else if( p_frontend->info.type == FE_QPSK ) else if( p_frontend->info.type == FE_QPSK )
return ScanParametersDvbS( p_access, p_scan ); /* DVB-S */ return ScanParametersDvbS( p_access, p_scan ); /* DVB-S */
msg_Err( p_access, "Frontend type not supported for scanning" ); msg_Err( p_access, "frontend scanning not supported" );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -492,15 +487,13 @@ void FrontendStatus( access_t *p_access ) ...@@ -492,15 +487,13 @@ void FrontendStatus( access_t *p_access )
frontend_t *p_frontend = p_sys->p_frontend; frontend_t *p_frontend = p_sys->p_frontend;
char *p = p_sys->psz_frontend_info = malloc( 10000 ); char *p = p_sys->psz_frontend_info = malloc( 10000 );
fe_status_t i_status; fe_status_t i_status;
int i_ret;
/* Determine type of frontend */ /* Determine type of frontend */
if( (i_ret = ioctl( p_sys->i_frontend_handle, FE_GET_INFO, if( ioctl( p_sys->i_frontend_handle, FE_GET_INFO, &p_frontend->info ) < 0 )
&p_frontend->info )) < 0 )
{ {
char buf[1000]; char buf[1000];
strerror_r( errno, buf, sizeof( buf ) ); strerror_r( errno, buf, sizeof( buf ) );
p += sprintf( p, "ioctl FE_GET_INFO failed (%d) %s\n", i_ret, buf ); p += sprintf( p, "ioctl FE_GET_INFO failed %s\n", buf );
goto out; goto out;
} }
...@@ -583,13 +576,11 @@ void FrontendStatus( access_t *p_access ) ...@@ -583,13 +576,11 @@ void FrontendStatus( access_t *p_access )
p += sprintf( p, "</table><p>Current frontend status:\n<table border=1>" ); p += sprintf( p, "</table><p>Current frontend status:\n<table border=1>" );
if( (i_ret = ioctl( p_sys->i_frontend_handle, FE_READ_STATUS, &i_status )) if( ioctl( p_sys->i_frontend_handle, FE_READ_STATUS, &i_status ) < 0 )
< 0 )
{ {
char buf[1000]; char buf[1000];
strerror_r( errno, buf, sizeof( buf ) ); strerror_r( errno, buf, sizeof( buf ) );
p += sprintf( p, "</table>ioctl FE_READ_STATUS failed (%d) %s\n", p += sprintf( p, "</table>ioctl FE_READ_STATUS failed %s\n", buf );
i_ret, buf );
goto out; goto out;
} }
...@@ -639,13 +630,11 @@ static int FrontendInfo( access_t *p_access ) ...@@ -639,13 +630,11 @@ static int FrontendInfo( access_t *p_access )
{ {
access_sys_t *p_sys = p_access->p_sys; access_sys_t *p_sys = p_access->p_sys;
frontend_t *p_frontend = p_sys->p_frontend; frontend_t *p_frontend = p_sys->p_frontend;
int i_ret;
/* Determine type of frontend */ /* Determine type of frontend */
if( (i_ret = ioctl( p_sys->i_frontend_handle, FE_GET_INFO, if( ioctl( p_sys->i_frontend_handle, FE_GET_INFO, &p_frontend->info ) < 0 )
&p_frontend->info )) < 0 )
{ {
msg_Err( p_access, "ioctl FE_GET_INFO failed (%d): %m", i_ret ); msg_Err( p_access, "frontend info request error: %m" );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -863,7 +852,6 @@ static int DoDiseqc( access_t *p_access ) ...@@ -863,7 +852,6 @@ static int DoDiseqc( access_t *p_access )
int i_frequency, i_lnb_slof; int i_frequency, i_lnb_slof;
fe_sec_voltage_t fe_voltage; fe_sec_voltage_t fe_voltage;
fe_sec_tone_mode_t fe_tone; fe_sec_tone_mode_t fe_tone;
int i_err;
i_frequency = var_GetInteger( p_access, "dvb-frequency" ); i_frequency = var_GetInteger( p_access, "dvb-frequency" );
i_lnb_slof = var_GetInteger( p_access, "dvb-lnb-slof" ); i_lnb_slof = var_GetInteger( p_access, "dvb-lnb-slof" );
...@@ -882,28 +870,24 @@ static int DoDiseqc( access_t *p_access ) ...@@ -882,28 +870,24 @@ static int DoDiseqc( access_t *p_access )
fe_tone = DecodeTone( p_access ); fe_tone = DecodeTone( p_access );
/* Switch off continuous tone. */ /* Switch off continuous tone. */
if( (i_err = ioctl( p_sys->i_frontend_handle, FE_SET_TONE, SEC_TONE_OFF )) < 0 ) if( ioctl( p_sys->i_frontend_handle, FE_SET_TONE, SEC_TONE_OFF ) < 0 )
{ {
msg_Err( p_access, "ioctl FE_SET_TONE failed, tone=%s (%d) %m", msg_Err( p_access, "switching tone %s error: %m", "off" );
fe_tone == SEC_TONE_ON ? "on" : "off", i_err ); return VLC_EGENERIC;
return i_err;
} }
/* Configure LNB voltage. */ /* Configure LNB voltage. */
if( (i_err = ioctl( p_sys->i_frontend_handle, FE_SET_VOLTAGE, fe_voltage )) < 0 ) if( ioctl( p_sys->i_frontend_handle, FE_SET_VOLTAGE, fe_voltage ) < 0 )
{ {
msg_Err( p_access, "ioctl FE_SET_VOLTAGE failed, voltage=%d (%d) %m", msg_Err( p_access, "voltage error: %m" );
fe_voltage, i_err ); return VLC_EGENERIC;
return i_err;
} }
b_val = var_GetBool( p_access, "dvb-high-voltage" ); b_val = var_GetBool( p_access, "dvb-high-voltage" );
if( (i_err = ioctl( p_sys->i_frontend_handle, FE_ENABLE_HIGH_LNB_VOLTAGE, if( ioctl( p_sys->i_frontend_handle,
b_val )) < 0 && b_val ) FE_ENABLE_HIGH_LNB_VOLTAGE, b_val ) < 0 && b_val )
{ {
msg_Err( p_access, msg_Err( p_access, "high LNB voltage error: %m" );
"ioctl FE_ENABLE_HIGH_LNB_VOLTAGE failed, val=%d (%d) %m",
b_val, i_err );
} }
/* Wait for at least 15 ms. */ /* Wait for at least 15 ms. */
...@@ -927,33 +911,31 @@ static int DoDiseqc( access_t *p_access ) ...@@ -927,33 +911,31 @@ static int DoDiseqc( access_t *p_access )
| (fe_voltage == SEC_VOLTAGE_13 ? 0 : 2) | (fe_voltage == SEC_VOLTAGE_13 ? 0 : 2)
| (fe_tone == SEC_TONE_ON ? 1 : 0); | (fe_tone == SEC_TONE_ON ? 1 : 0);
if( (i_err = ioctl( p_sys->i_frontend_handle, FE_DISEQC_SEND_MASTER_CMD, if( ioctl( p_sys->i_frontend_handle, FE_DISEQC_SEND_MASTER_CMD,
&cmd.cmd )) < 0 ) &cmd.cmd ) )
{ {
msg_Err( p_access, "ioctl FE_SEND_MASTER_CMD failed (%d) %m", msg_Err( p_access, "master command sending error: %m" );
i_err ); return VLC_EGENERIC;
return i_err;
} }
msleep(15000 + cmd.wait * 1000); msleep(15000 + cmd.wait * 1000);
/* A or B simple diseqc ("diseqc-compatible") */ /* A or B simple diseqc ("diseqc-compatible") */
if( (i_err = ioctl( p_sys->i_frontend_handle, FE_DISEQC_SEND_BURST, if( ioctl( p_sys->i_frontend_handle, FE_DISEQC_SEND_BURST,
((i_val - 1) % 2) ? SEC_MINI_B : SEC_MINI_A )) < 0 ) ((i_val - 1) % 2) ? SEC_MINI_B : SEC_MINI_A ) )
{ {
msg_Err( p_access, "ioctl FE_SEND_BURST failed (%d) %m", msg_Err( p_access, "burst sending error: %m" );
i_err ); return VLC_EGENERIC;
return i_err;
} }
msleep(15000); msleep(15000);
} }
if( (i_err = ioctl( p_sys->i_frontend_handle, FE_SET_TONE, fe_tone )) < 0 ) if( ioctl( p_sys->i_frontend_handle, FE_SET_TONE, fe_tone ) )
{ {
msg_Err( p_access, "ioctl FE_SET_TONE failed, tone=%s (%d) %m", msg_Err( p_access, "switching tone %s error: %m",
fe_tone == SEC_TONE_ON ? "on" : "off", i_err ); (fe_tone == SEC_TONE_ON) ? "on" : "off" );
return i_err; return VLC_EGENERIC;
} }
msleep(50000); msleep(50000);
...@@ -964,7 +946,6 @@ static int FrontendSetQPSK( access_t *p_access ) ...@@ -964,7 +946,6 @@ static int FrontendSetQPSK( access_t *p_access )
{ {
access_sys_t *p_sys = p_access->p_sys; access_sys_t *p_sys = p_access->p_sys;
struct dvb_frontend_parameters fep; struct dvb_frontend_parameters fep;
int i_ret;
int i_val; int i_val;
int i_frequency, i_lnb_slof = 0, i_lnb_lof1, i_lnb_lof2 = 0; int i_frequency, i_lnb_slof = 0, i_lnb_lof1, i_lnb_lof2 = 0;
...@@ -1055,9 +1036,9 @@ static int FrontendSetQPSK( access_t *p_access ) ...@@ -1055,9 +1036,9 @@ static int FrontendSetQPSK( access_t *p_access )
} }
/* Now send it all to the frontend device */ /* Now send it all to the frontend device */
if( (i_ret = ioctl( p_sys->i_frontend_handle, FE_SET_FRONTEND, &fep )) < 0 ) if( ioctl( p_sys->i_frontend_handle, FE_SET_FRONTEND, &fep ) < 0 )
{ {
msg_Err( p_access, "DVB-S: setting frontend failed (%d) %m", i_ret ); msg_Err( p_access, "frontend error: %m" );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -1073,7 +1054,6 @@ static int FrontendSetQAM( access_t *p_access ) ...@@ -1073,7 +1054,6 @@ static int FrontendSetQAM( access_t *p_access )
frontend_t *p_frontend = p_sys->p_frontend; frontend_t *p_frontend = p_sys->p_frontend;
struct dvb_frontend_parameters fep; struct dvb_frontend_parameters fep;
int i_val; int i_val;
int i_ret;
/* Prepare the fep structure */ /* Prepare the fep structure */
...@@ -1106,9 +1086,9 @@ static int FrontendSetQAM( access_t *p_access ) ...@@ -1106,9 +1086,9 @@ static int FrontendSetQAM( access_t *p_access )
} }
/* Now send it all to the frontend device */ /* Now send it all to the frontend device */
if( (i_ret = ioctl( p_sys->i_frontend_handle, FE_SET_FRONTEND, &fep )) < 0 ) if( ioctl( p_sys->i_frontend_handle, FE_SET_FRONTEND, &fep ) < 0 )
{ {
msg_Err( p_access, "DVB-C: setting frontend failed (%d): %m", i_ret ); msg_Err( p_access, "frontend error: %m" );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -1207,7 +1187,6 @@ static int FrontendSetOFDM( access_t * p_access ) ...@@ -1207,7 +1187,6 @@ static int FrontendSetOFDM( access_t * p_access )
{ {
access_sys_t *p_sys = p_access->p_sys; access_sys_t *p_sys = p_access->p_sys;
struct dvb_frontend_parameters fep; struct dvb_frontend_parameters fep;
int ret;
/* Prepare the fep structure */ /* Prepare the fep structure */
...@@ -1233,10 +1212,10 @@ static int FrontendSetOFDM( access_t * p_access ) ...@@ -1233,10 +1212,10 @@ static int FrontendSetOFDM( access_t * p_access )
} }
/* Now send it all to the frontend device */ /* Now send it all to the frontend device */
if( (ret = ioctl( p_sys->i_frontend_handle, FE_SET_FRONTEND, &fep )) < 0 ) if( ioctl( p_sys->i_frontend_handle, FE_SET_FRONTEND, &fep ) < 0 )
{ {
msg_Err( p_access, "DVB-T: setting frontend failed (%d): %m", ret ); msg_Err( p_access, "frontend error: %m" );
return -1; return VLC_EGENERIC;
} }
return VLC_SUCCESS; return VLC_SUCCESS;
...@@ -1249,7 +1228,6 @@ static int FrontendSetATSC( access_t *p_access ) ...@@ -1249,7 +1228,6 @@ static int FrontendSetATSC( access_t *p_access )
{ {
access_sys_t *p_sys = p_access->p_sys; access_sys_t *p_sys = p_access->p_sys;
struct dvb_frontend_parameters fep; struct dvb_frontend_parameters fep;
int i_ret;
/* Prepare the fep structure */ /* Prepare the fep structure */
...@@ -1267,9 +1245,9 @@ static int FrontendSetATSC( access_t *p_access ) ...@@ -1267,9 +1245,9 @@ static int FrontendSetATSC( access_t *p_access )
} }
/* Now send it all to the frontend device */ /* Now send it all to the frontend device */
if( (i_ret = ioctl( p_sys->i_frontend_handle, FE_SET_FRONTEND, &fep )) < 0 ) if( ioctl( p_sys->i_frontend_handle, FE_SET_FRONTEND, &fep ) < 0 )
{ {
msg_Err( p_access, "ATSC: setting frontend failed (%d): %m", i_ret ); msg_Err( p_access, "frontend error: %m" );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -1287,7 +1265,6 @@ static int FrontendSetATSC( access_t *p_access ) ...@@ -1287,7 +1265,6 @@ static int FrontendSetATSC( access_t *p_access )
int DMXSetFilter( access_t * p_access, int i_pid, int * pi_fd, int i_type ) int DMXSetFilter( access_t * p_access, int i_pid, int * pi_fd, int i_type )
{ {
struct dmx_pes_filter_params s_filter_params; struct dmx_pes_filter_params s_filter_params;
int i_ret;
unsigned int i_adapter, i_device; unsigned int i_adapter, i_device;
char dmx[128]; char dmx[128];
...@@ -1408,9 +1385,9 @@ int DMXSetFilter( access_t * p_access, int i_pid, int * pi_fd, int i_type ) ...@@ -1408,9 +1385,9 @@ int DMXSetFilter( access_t * p_access, int i_pid, int * pi_fd, int i_type )
} }
/* We then give the order to the device : */ /* We then give the order to the device : */
if( (i_ret = ioctl( *pi_fd, DMX_SET_PES_FILTER, &s_filter_params )) < 0 ) if( ioctl( *pi_fd, DMX_SET_PES_FILTER, &s_filter_params ) )
{ {
msg_Err( p_access, "DMXSetFilter: failed with %d (%m)", i_ret ); msg_Err( p_access, "setting demux PES filter failed: %m" );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
return VLC_SUCCESS; return VLC_SUCCESS;
...@@ -1421,12 +1398,10 @@ int DMXSetFilter( access_t * p_access, int i_pid, int * pi_fd, int i_type ) ...@@ -1421,12 +1398,10 @@ int DMXSetFilter( access_t * p_access, int i_pid, int * pi_fd, int i_type )
*****************************************************************************/ *****************************************************************************/
int DMXUnsetFilter( access_t * p_access, int i_fd ) int DMXUnsetFilter( access_t * p_access, int i_fd )
{ {
int i_ret; if( ioctl( i_fd, DMX_STOP ) < 0 )
if( (i_ret = ioctl( i_fd, DMX_STOP )) < 0 )
{ {
msg_Err( p_access, "DMX_STOP failed for demux (%d): %m", i_ret ); msg_Err( p_access, "stopping demux failed: %m" );
return i_ret; return VLC_EGENERIC;
} }
msg_Dbg( p_access, "DMXUnsetFilter: closing demux %d", i_fd ); msg_Dbg( p_access, "DMXUnsetFilter: closing demux %d", i_fd );
......
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