# HG changeset patch # User henry # Date 1040081259 0 # Node ID c268bbb804d92b0f423fc2b4e9bf951627fd36bc # Parent 4e32317f08becd005f1e990479593799131aec2a handle bogus norm parameter; check for errors when setting norm diff -r 4e32317f08be -r c268bbb804d9 libmpdemux/tv.c --- a/libmpdemux/tv.c Mon Dec 16 23:24:02 2002 +0000 +++ b/libmpdemux/tv.c Mon Dec 16 23:27:39 2002 +0000 @@ -159,21 +159,16 @@ tvh->norm = TV_NORM_NTSC; else if (!strcasecmp(tv_param_norm, "secam")) tvh->norm = TV_NORM_SECAM; - else if (!strcasecmp(tv_param_norm, "palnc")) - tvh->norm = TV_NORM_PALNC; - else if (!strcasecmp(tv_param_norm, "palm")) - tvh->norm = TV_NORM_PALM; - else if (!strcasecmp(tv_param_norm, "paln")) - tvh->norm = TV_NORM_PALN; - else if (!strcasecmp(tv_param_norm, "ntscjp")) - tvh->norm = TV_NORM_NTSCJP; else { mp_msg(MSGT_TV, MSGL_V, "Bogus norm parameter, setting PAL.\n"); tvh->norm = TV_NORM_PAL; } mp_msg(MSGT_TV, MSGL_V, "Selected norm: %s\n", tv_param_norm); - funcs->control(tvh->priv, TVI_CONTROL_TUN_SET_NORM, &tvh->norm); + if (funcs->control(tvh->priv, TVI_CONTROL_TUN_SET_NORM, &tvh->norm) != TVI_CONTROL_TRUE) { + mp_msg(MSGT_TV, MSGL_ERR, "Error: cannot set norm!\n"); + return 0; + } /* limits on w&h are norm-dependent -- JM */ /* set width */