﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	mlocked
1960	patch for wraptimecode - fix multiple 'Guessing avsync'	mythdev@…	Isaac Richards	"I've just had a period where on change to some lower resolution dvb channels  I was getting bad stuttering and the logs had multiple 'Guessing at new AV sync values' messages which originate in NuppelVideoPlayer::WrapTimecode.
I added a debug printout to show the values of timecode,lastval[TC_AUDIO],tc_wrap[TC_AUDIO], lastval[TC_VIDEO]and tc_diff_estimate. This showed that the AUTO_RESYNC code was effectively doubling what should be the value of tc_wrap - leading to the Guess being invoked every 30 calls. The attached patch fixes this.

Note that the value of TC_WRAP can be negative (with or without the patch) and I think this means that there is a corner case where the initial 'wrap test' 
{{{
// wrapped
if (timecode < tc_lastval[tc_type] - 10000)
}}}
is triggered when it shouldn't be - I only got this behaviour once in a few hundred channel changes."	patch	closed	minor	0.20	mythtv	head	low	fixed			0
