--- orig/tvi_v4l.c 2002-12-14 12:14:56.000000000 +0100 +++ tvi_v4l.c 2002-12-16 21:02:43.000000000 +0100 @@ -986,6 +986,8 @@ } if (priv->channels[priv->act_channel].flags & VIDEO_VC_TUNER) { + int prev_mode; + control(priv, TVI_CONTROL_TUN_GET_TUNER, 0); if (((req_mode == TV_NORM_PAL) && !(priv->tuner.flags & VIDEO_TUNER_PAL)) || ((req_mode == TV_NORM_NTSC) && !(priv->tuner.flags & VIDEO_TUNER_NTSC)) || @@ -995,6 +997,8 @@ return(TVI_CONTROL_FALSE); } + prev_mode = priv->tuner.mode; + switch(req_mode) { case TV_NORM_PAL: priv->tuner.mode = VIDEO_MODE_PAL; @@ -1008,7 +1012,8 @@ } if (control(priv, TVI_CONTROL_TUN_SET_TUNER, &priv->tuner) != TVI_CONTROL_TRUE) { - return(TVI_CONTROL_FALSE); + // norm setting failed, but maybe it's only because it's fixed + if (priv->tuner.mode != prev_mode) return(TVI_CONTROL_FALSE); // no it really failed } } @@ -1260,11 +1265,14 @@ interval = (double)framecount/priv->fps; } - if (!priv->immediate_mode && ( - (interval - prev_interval < (long long)0.85e6/priv->fps) - || (interval - prev_interval > (long long)1.15e6/priv->fps) ) ) { - mp_msg(MSGT_TV, MSGL_V, "\nvideo capture thread: frame delta ~ %.1lf fps\n", - (double)1e6/(interval - prev_interval)); + if (!priv->immediate_mode) { + if (interval - prev_interval == 0) { + mp_msg(MSGT_TV, MSGL_V, "\nvideo capture thread: frame delta = 0\n"); + } else if ((interval - prev_interval < (long long)0.85e6/priv->fps) + || (interval - prev_interval > (long long)1.15e6/priv->fps) ) { + mp_msg(MSGT_TV, MSGL_V, "\nvideo capture thread: frame delta ~ %.1lf fps\n", + (double)1e6/(interval - prev_interval)); + } } // interpolate the skew in time @@ -1282,7 +1290,8 @@ } mp_msg(MSGT_TV, MSGL_DBG3, "\nfps = %lf, interval = %lf, a_skew = %f, corr_skew = %f\n", - (double)1e6/(interval - prev_interval), (double)1e-6*interval, (double)1e-6*xskew, (double)1e-6*skew); + (interval != prev_interval) ? (double)1e6/(interval - prev_interval) : -1, + (double)1e-6*interval, (double)1e-6*xskew, (double)1e-6*skew); mp_msg(MSGT_TV, MSGL_DBG3, "vcnt = %d, acnt = %d\n", priv->video_cnt, priv->audio_cnt); prev_skew = skew;