Commit 1a031d36 authored by massiot's avatar massiot

* dvb.c: Add support for adapters with multiple frontend, patch courtesy

   of Andy Gatward.


git-svn-id: svn://svn.videolan.org/dvblast/trunk@8 55d3f8b6-4a41-4d2d-a900-313d1436a5b8
parent a6d48d21
......@@ -83,7 +83,7 @@ void dvb_Open( void )
{
char psz_tmp[128];
sprintf( psz_tmp, "/dev/dvb/adapter%d/frontend0", i_adapter );
sprintf( psz_tmp, "/dev/dvb/adapter%d/frontend%d", i_adapter, i_fenum );
if( (i_frontend = open(psz_tmp, O_RDWR | O_NONBLOCK)) < 0 )
{
msg_Err( NULL, "opening device %s failed (%s)", psz_tmp,
......@@ -93,7 +93,7 @@ void dvb_Open( void )
FrontendSet();
sprintf( psz_tmp, "/dev/dvb/adapter%d/dvr0", i_adapter );
sprintf( psz_tmp, "/dev/dvb/adapter%d/dvr%d", i_adapter, i_fenum );
if( (i_dvr = open(psz_tmp, O_RDONLY)) < 0 )
{
......@@ -243,7 +243,7 @@ int dvb_SetFilter( uint16_t i_pid )
char psz_tmp[128];
int i_fd;
sprintf( psz_tmp, "/dev/dvb/adapter%d/demux0", i_adapter );
sprintf( psz_tmp, "/dev/dvb/adapter%d/demux%d", i_adapter, i_fenum );
if( (i_fd = open(psz_tmp, O_RDWR)) < 0 )
{
msg_Err( NULL, "DMXSetFilter: opening device failed (%s)",
......
......@@ -46,6 +46,7 @@ int i_ttl = 64;
in_addr_t i_ssrc = 0;
static int i_priority = -1;
int i_adapter = 0;
int i_fenum = 0;
int i_frequency = 0;
int i_srate = 27500000;
int i_voltage = 13;
......@@ -180,7 +181,7 @@ static void SigHandler( int i_signal )
*****************************************************************************/
void usage()
{
msg_Err( NULL, "Usage: dvblast -c <config file> [-r <remote socket>] [-t <ttl>] [-o <SSRC IP>] [-i <RT priority>] [-a <adapter>] -f <frequency> [-s <symbol rate>] [-v <0|13|18>] [-p] [-b <bandwidth>] [-m <modulation] [-u] [-d <dest IP:port>]" );
msg_Err( NULL, "Usage: dvblast -c <config file> [-r <remote socket>] [-t <ttl>] [-o <SSRC IP>] [-i <RT priority>] [-a <adapter>][-n <frontend_num>] -f <frequency> [-s <symbol rate>] [-v <0|13|18>] [-p] [-b <bandwidth>] [-m <modulation] [-u] [-d <dest IP:port>]" );
msg_Err( NULL, "-v: voltage to apply to the LNB (QPSK)" );
msg_Err( NULL, "-p: force 22kHz pulses for high-band selection (DVB-S)" );
msg_Err( NULL, "-m: DVB-C qpsk|qam_16|qam_32|qam_64|qam_128|qam_256 (default qam_auto)" );
......@@ -205,7 +206,7 @@ int main( int i_argc, char **pp_argv )
{
char c;
if ( (c = getopt(i_argc, pp_argv, "c:r:t:o:i:a:f:s:v:pb:m:ud:h")) == -1 )
if ( (c = getopt(i_argc, pp_argv, "c:r:t:o:i:a:n:f:s:v:pb:m:ud:h")) == -1 )
break;
switch ( c )
......@@ -239,6 +240,10 @@ int main( int i_argc, char **pp_argv )
i_adapter = strtol( optarg, NULL, 0 );
break;
case 'n':
i_fenum = strtol( optarg, NULL, 0 );
break;
case 'f':
i_frequency = strtol( optarg, NULL, 0 );
break;
......
......@@ -80,6 +80,7 @@ extern char *psz_srv_socket;
extern int i_ttl;
extern in_addr_t i_ssrc;
extern int i_adapter;
extern int i_fenum;
extern int i_frequency;
extern int i_srate;
extern int i_voltage;
......
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