diff stream/tv.c @ 24762:1ed81edfac75

Disable channel scanner when no tuner is present. TV channel scanner is useless without tuner and causes mplayer crash due to uninitialized chanlist_s variable (e.g when dummy driver and tvscan are used together).
author voroshil
date Mon, 15 Oct 2007 17:46:17 +0000
parents 1c9d285e5a25
children 1777d38d020d
line wrap: on
line diff
--- a/stream/tv.c	Mon Oct 15 11:58:39 2007 +0000
+++ b/stream/tv.c	Mon Oct 15 17:46:17 2007 +0000
@@ -88,6 +88,14 @@
     tv_scan_t* scan;
     int found=0, index=1;
 
+    //Channel scanner without tuner is useless and causes crash due to uninitialized chanlist_s
+    if (tvh->functions->control(tvh->priv, TVI_CONTROL_IS_TUNER, 0) != TVI_CONTROL_TRUE)
+    {
+        mp_msg(MSGT_TV, MSGL_WARN, MSGTR_TV_ScannerNotAvailableWithoutTuner);
+        tvh->tv_param->scan=0;
+        return;
+    }
+
     scan = tvh->scan;
     now=GetTimer();
     if (!scan) {