# HG changeset patch # User voroshil # Date 1192470377 0 # Node ID 1ed81edfac75e33f07050aca882a4e5e481f50e9 # Parent 327b7e9f6a2c40f6a360a1728e07f6b0d8d0a5ef 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). diff -r 327b7e9f6a2c -r 1ed81edfac75 help/help_mp-en.h --- a/help/help_mp-en.h Mon Oct 15 11:58:39 2007 +0000 +++ b/help/help_mp-en.h Mon Oct 15 17:46:17 2007 +0000 @@ -2099,6 +2099,7 @@ #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 -r 327b7e9f6a2c -r 1ed81edfac75 stream/tv.c --- 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) {