]> git.sesse.net Git - vlc/commitdiff
Improved handling of no-signal condition and other errors
authorKen Self <kenself@videolan.org>
Tue, 15 May 2007 20:54:29 +0000 (20:54 +0000)
committerKen Self <kenself@videolan.org>
Tue, 15 May 2007 20:54:29 +0000 (20:54 +0000)
modules/access/bda/bda.c
modules/access/bda/bdagraph.cpp

index 47378283885dafba02424173d59f8734f8451bc5..31f375d8c2bb55d5764b97153264d53b5e1d34ed 100644 (file)
@@ -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;
 }
index b45d39c16c44b3bbbc65f27f9e16127f40a97b69..94b12d07632357a235d0dcb180dd523631270b2c 100644 (file)
@@ -37,38 +37,51 @@ extern "C" {
 
     void dvb_deleteBDAGraph( access_t* p_access )
     {
-        delete p_access->p_sys->p_bda_module;
+        if( p_access->p_sys->p_bda_module )
+            delete p_access->p_sys->p_bda_module;
     };
 
     int dvb_SubmitATSCTuneRequest( access_t* p_access )
     {
-        return p_access->p_sys->p_bda_module->SubmitATSCTuneRequest();
+        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 )
     {
-        return p_access->p_sys->p_bda_module->SubmitDVBTTuneRequest();
+        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 )
     {
-        return p_access->p_sys->p_bda_module->SubmitDVBCTuneRequest();
+        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 )
     {
-        return p_access->p_sys->p_bda_module->SubmitDVBSTuneRequest();
+        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 )
     {
-        return p_access->p_sys->p_bda_module->GetBufferSize();
+        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 )
     {
-        return p_access->p_sys->p_bda_module->ReadBuffer( l_buffer_len, 
-            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;
     }