* Preamble
*****************************************************************************/
#include <vlc/vlc.h>
-#include <vlc/input.h>
+#include <vlc_access.h>
+#include <vlc_interface.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
+#include <sys/poll.h>
#include <errno.h>
#define CACHING_TEXT N_("Caching value in ms")
#define CACHING_LONGTEXT N_( \
- "Allows you to modify the default caching value for dvb streams. This " \
- "value should be set in millisecond units." )
+ "Caching value for DVB streams. This " \
+ "value should be set in milliseconds." )
#define ADAPTER_TEXT N_("Adapter card to tune")
#define ADAPTER_LONGTEXT N_("Adapter cards have a device file in directory named /dev/dvb/adapter[n] with n>=0.")
#define INVERSION_LONGTEXT N_("Inversion mode [0=off, 1=on, 2=auto]")
#define PROBE_TEXT N_("Probe DVB card for capabilities")
-#define PROBE_LONGTEXT N_("Some DVB cards do not like to be probed for their capabilities.")
+#define PROBE_LONGTEXT N_("Some DVB cards do not like to be probed for their capabilities, you can disable this feature if you experience some trouble.")
#define BUDGET_TEXT N_("Budget mode")
-#define BUDGET_LONGTEXT N_("This allows you to stream an entire transponder with a budget card.")
+#define BUDGET_LONGTEXT N_("This allows you to stream an entire transponder with a \"budget\" card.")
/* Satellite */
#define SATNO_TEXT N_("Satellite number in the Diseqc system")
-#define SATNO_LONGTEXT N_("[0=no diseqc, 1-4=satellite number]")
+#define SATNO_LONGTEXT N_("[0=no diseqc, 1-4=satellite number].")
#define VOLTAGE_TEXT N_("LNB voltage")
-#define VOLTAGE_LONGTEXT N_("In Volts [0, 13=vertical, 18=horizontal]")
+#define VOLTAGE_LONGTEXT N_("In Volts [0, 13=vertical, 18=horizontal].")
#define HIGH_VOLTAGE_TEXT N_("High LNB voltage")
#define HIGH_VOLTAGE_LONGTEXT N_("Enable high voltage if your cables are " \
"particularly long. This is not supported by all frontends.")
#define TONE_TEXT N_("22 kHz tone")
-#define TONE_LONGTEXT N_("[0=off, 1=on, -1=auto]")
+#define TONE_LONGTEXT N_("[0=off, 1=on, -1=auto].")
#define FEC_TEXT N_("Transponder FEC")
-#define FEC_LONGTEXT N_("FEC=Forward Error Correction mode [9=auto]")
+#define FEC_LONGTEXT N_("FEC=Forward Error Correction mode [9=auto].")
#define SRATE_TEXT N_("Transponder symbol rate in kHz")
#define SRATE_LONGTEXT ""
#define USER_TEXT N_( "HTTP user name" )
#define USER_LONGTEXT N_( \
- "You can set the user name the administrator will use to log into " \
+ "User name the administrator will use to log into " \
"the internal HTTP server." )
#define PASSWORD_TEXT N_( "HTTP password" )
#define PASSWORD_LONGTEXT N_( \
- "You can set the password the administrator will use to log into " \
+ "Password the administrator will use to log into " \
"the internal HTTP server." )
#define ACL_TEXT N_( "HTTP ACL" )
#define ACL_LONGTEXT N_( \
- "You can set the access control list (equivalent to .hosts) file path, " \
+ "Access control list (equivalent to .hosts) file path, " \
"which will limit the range of IPs entitled to log into the internal " \
"HTTP server." )
vlc_module_begin();
set_shortname( _("DVB") );
- set_description( N_("DVB input with v4l2 support") );
+ set_description( _("DVB input with v4l2 support") );
set_category( CAT_INPUT );
set_subcategory( SUBCAT_INPUT_ACCESS );
#endif
set_capability( "access2", 0 );
- add_shortcut( "dvb" );
- add_shortcut( "dvb-s" );
+ add_shortcut( "dvb" ); /* Generic name */
+
+ add_shortcut( "dvb-s" ); /* Satellite */
add_shortcut( "qpsk" );
- add_shortcut( "dvb-c" );
+ add_shortcut( "satellite" );
+
+ add_shortcut( "dvb-c" ); /* Cable */
add_shortcut( "cable" );
- add_shortcut( "dvb-t" );
+
+ add_shortcut( "dvb-t" ); /* Terrestrial */
add_shortcut( "terrestrial" );
- add_shortcut( "satellite" ); /* compatibility with the interface. */
+
+ add_shortcut( "atsc" ); /* Atsc */
+ add_shortcut( "usdigital" );
+
set_callbacks( Open, Close );
vlc_module_end();
p_access->info.i_seekpoint = 0;
p_access->p_sys = p_sys = malloc( sizeof( access_sys_t ) );
+ if( !p_sys )
+ return VLC_ENOMEM;
+
memset( p_sys, 0, sizeof( access_sys_t ) );
/* Create all variables */
for ( ; ; )
{
- struct timeval timeout;
- fd_set fds, fde;
+ struct pollfd ufds[2];
int i_ret;
- int i_max_handle = p_sys->i_handle;
/* Initialize file descriptor sets */
- FD_ZERO( &fds );
- FD_ZERO( &fde );
- FD_SET( p_sys->i_handle, &fds );
- FD_SET( p_sys->i_frontend_handle, &fde );
- if ( p_sys->i_frontend_handle > i_max_handle )
- i_max_handle = p_sys->i_frontend_handle;
+ memset (ufds, 0, sizeof (ufds));
+ ufds[0].fd = p_sys->i_handle;
+ ufds[0].events = POLLIN;
+ ufds[1].fd = p_sys->i_frontend_handle;
+ ufds[1].events = POLLPRI;
/* We'll wait 0.5 second if nothing happens */
- timeout.tv_sec = 0;
- timeout.tv_usec = 500000;
-
/* Find if some data is available */
- i_ret = select( i_max_handle + 1, &fds, NULL, &fde, &timeout );
+ i_ret = poll( ufds, 2, 500 );
if ( p_access->b_die )
return NULL;
- if ( i_ret < 0 && errno == EINTR )
- continue;
-
if ( i_ret < 0 )
{
- msg_Err( p_access, "select error (%s)", strerror(errno) );
+ if( errno == EINTR )
+ continue;
+
+ msg_Err( p_access, "poll error: %s", strerror(errno) );
return NULL;
}
p_sys->i_ca_next_event = mdate() + p_sys->i_ca_timeout;
}
- if ( FD_ISSET( p_sys->i_frontend_handle, &fde ) )
+ if ( ufds[1].revents )
{
E_(FrontendPoll)( p_access );
}
E_(FrontendSet)( p_access );
}
- if ( FD_ISSET( p_sys->i_handle, &fds ) )
+ if ( ufds[0].revents )
{
p_block = block_New( p_access,
p_sys->i_read_once * TS_PACKET_SIZE );
{
msg_Err( p_access, "the DVB input old syntax is deprecated, use vlc "
"-p dvb to see an explanation of the new syntax" );
+ intf_UserFatal( p_access, VLC_TRUE, _("Input syntax is deprecated"),
+ _("The given syntax is deprecated. Run \"vlc -p dvb\" to see an " \
+ "explanation of the new syntax.") );
free( psz_dup );
return VLC_EGENERIC;
}
else
{
msg_Err( p_access, "illegal polarization %c", *psz_parser );
+ intf_UserFatal( p_access, VLC_FALSE, _("Illegal Polarization"),
+ _("The provided polarization \"%c\" is not valid."),
+ *psz_parser );
free( psz_dup );
return VLC_EGENERIC;
}