Commit 3cf4ef1e authored by Ken Self's avatar Ken Self

Improved handling of no-signal condition and other errors

parent 68d81870
......@@ -49,7 +49,11 @@ static int Control( access_t *, int, va_list );
#define DEVICE_LONGTEXT ""
#define FREQ_TEXT N_("Transponder/multiplex frequency")
#define FREQ_LONGTEXT N_("In kHz for DVB-S or Hz for DVB-C/T")
#if defined(WIN32) || defined(WINCE)
# define FREQ_LONGTEXT N_("In kHz for DVB-S or Hz for DVB-C/T")
#else
# define FREQ_LONGTEXT N_("In kHz for DVB-C/S/T")
#endif
#define INVERSION_TEXT N_("Inversion mode")
#define INVERSION_LONGTEXT N_("Inversion mode [0=off, 1=on, 2=auto]")
......@@ -495,11 +499,17 @@ static block_t *Block( access_t *p_access )
l_buffer_len = dvb_GetBufferSize( p_access );
if( l_buffer_len < 0 )
{
p_access->info.b_eof = VLC_TRUE;
return NULL;
}
p_block = block_New( p_access, l_buffer_len );
if( dvb_ReadBuffer( p_access, &l_buffer_len, p_block->p_buffer ) < 0 )
{
p_access->info.b_eof = VLC_TRUE;
return NULL;
}
return p_block;
}
......@@ -37,38 +37,51 @@ extern "C" {
void dvb_deleteBDAGraph( access_t* p_access )
{
if( p_access->p_sys->p_bda_module )
delete p_access->p_sys->p_bda_module;
};
int dvb_SubmitATSCTuneRequest( access_t* p_access )
{
if( p_access->p_sys->p_bda_module )
return p_access->p_sys->p_bda_module->SubmitATSCTuneRequest();
return VLC_EGENERIC;
};
int dvb_SubmitDVBTTuneRequest( access_t* p_access )
{
if( p_access->p_sys->p_bda_module )
return p_access->p_sys->p_bda_module->SubmitDVBTTuneRequest();
return VLC_EGENERIC;
};
int dvb_SubmitDVBCTuneRequest( access_t* p_access )
{
if( p_access->p_sys->p_bda_module )
return p_access->p_sys->p_bda_module->SubmitDVBCTuneRequest();
return VLC_EGENERIC;
};
int dvb_SubmitDVBSTuneRequest( access_t* p_access )
{
if( p_access->p_sys->p_bda_module )
return p_access->p_sys->p_bda_module->SubmitDVBSTuneRequest();
return VLC_EGENERIC;
};
long dvb_GetBufferSize( access_t* p_access )
{
if( p_access->p_sys->p_bda_module )
return p_access->p_sys->p_bda_module->GetBufferSize();
return -1;
};
long dvb_ReadBuffer( access_t* p_access, long* l_buffer_len, BYTE* p_buff )
{
if( p_access->p_sys->p_bda_module )
return p_access->p_sys->p_bda_module->ReadBuffer( l_buffer_len,
p_buff );
return -1;
};
};
......@@ -460,7 +473,7 @@ int BDAGraph::SubmitDVBSTuneRequest()
hr = CreateTuneRequest();
if( FAILED( hr ) )
{
msg_Warn( p_access, "SubmitDVBCTuneRequest: "\
msg_Warn( p_access, "SubmitDVBSTuneRequest: "\
"Cannot create Tune Request: hr=0x%8lx", hr );
return VLC_EGENERIC;
}
......@@ -469,7 +482,7 @@ int BDAGraph::SubmitDVBSTuneRequest()
(void**)&l.p_dvbs_tune_request );
if( FAILED( hr ) )
{
msg_Warn( p_access, "SubmitDVBCTuneRequest: "\
msg_Warn( p_access, "SubmitDVBSTuneRequest: "\
"Cannot QI for IDVBTuneRequest: hr=0x%8lx", hr );
return VLC_EGENERIC;
}
......@@ -481,7 +494,7 @@ int BDAGraph::SubmitDVBSTuneRequest()
IID_IDVBSLocator, (void**)&l.p_dvbs_locator );
if( FAILED( hr ) )
{
msg_Warn( p_access, "SubmitDVBCTuneRequest: "\
msg_Warn( p_access, "SubmitDVBSTuneRequest: "\
"Cannot create the DVBS Locator: hr=0x%8lx", hr );
return VLC_EGENERIC;
}
......@@ -503,7 +516,7 @@ int BDAGraph::SubmitDVBSTuneRequest()
hr = l.p_dvbs_locator->put_SignalPolarisation( i_polar );
if( FAILED( hr ) )
{
msg_Warn( p_access, "SubmitDVBCTuneRequest: "\
msg_Warn( p_access, "SubmitDVBSTuneRequest: "\
"Cannot set tuning parameters on Locator: hr=0x%8lx", hr );
return VLC_EGENERIC;
}
......@@ -511,7 +524,7 @@ int BDAGraph::SubmitDVBSTuneRequest()
hr = p_tune_request->put_Locator( l.p_dvbs_locator );
if( FAILED( hr ) )
{
msg_Warn( p_access, "SubmitDVBCTuneRequest: "\
msg_Warn( p_access, "SubmitDVBSTuneRequest: "\
"Cannot put the locator: hr=0x%8lx", hr );
return VLC_EGENERIC;
}
......
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