summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvoroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-10-15 17:46:17 +0000
committervoroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-10-15 17:46:17 +0000
commite3212dafd51ea927633ec1d4b3fc6b46db0a9246 (patch)
tree283bc3f4a208506e705d0665f8938e31889f4119
parentd8b3a8e30ecba83d9c658e1dc5f083a2f15cad3f (diff)
downloadmpv-e3212dafd51ea927633ec1d4b3fc6b46db0a9246.tar.bz2
mpv-e3212dafd51ea927633ec1d4b3fc6b46db0a9246.tar.xz
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). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24790 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--help/help_mp-en.h1
-rw-r--r--stream/tv.c8
2 files changed, 9 insertions, 0 deletions
diff --git a/help/help_mp-en.h b/help/help_mp-en.h
index b3bf8c25a7..ac940360e0 100644
--- a/help/help_mp-en.h
+++ b/help/help_mp-en.h
@@ -2099,6 +2099,7 @@ static char help_text[]=
#define MSGTR_TV_Bt848UnableToStopCapture "tvi_bsdbt848: Unable to stop capture. Error: %s\n"
#define MSGTR_TV_TTSupportedLanguages "Supported Teletext languages:\n"
#define MSGTR_TV_TTSelectedLanguage "Selected default teletext language: %s\n"
+#define MSGTR_TV_ScannerNotAvailableWithoutTuner "Channel scanner is not available without tuner\n"
//tvi_dshow.c
#define MSGTR_TVI_DS_UnableConnectInputVideoDecoder "Unable to connect given input to video decoder. Error:0x%x\n"
diff --git a/stream/tv.c b/stream/tv.c
index a6683830c5..a026bfc6c8 100644
--- a/stream/tv.c
+++ b/stream/tv.c
@@ -88,6 +88,14 @@ static void tv_scan(tvi_handle_t *tvh)
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) {