#define PTS_32_PATTERN_DETECT_RANGE 10
#define PTS_22_PATTERN_DETECT_RANGE 10
#define PTS_41_PATTERN_DETECT_RANGE 2
+#define PTS_32_PATTERN_DURATION 3750
+#define PTS_22_PATTERN_DURATION 3000
+
enum video_refresh_pattern {
PTS_32_PATTERN = 0,
{
int pattern_range, expected_curr_interval;
int expected_prev_interval;
+ int next_vf_nextpts = 0;
/* Dont do anything if we have invalid data */
- if (!next_vf || !next_vf->pts || !next_vf->next_vf_pts_valid)
+ if (!next_vf || !next_vf->pts)
return;
+ if (next_vf->next_vf_pts_valid)
+ next_vf_nextpts = next_vf->next_vf_pts;
switch (pts_pattern_detected) {
case PTS_32_PATTERN:
default:
return;
}
+ if (!next_vf_nextpts)
+ next_vf_nextpts = next_vf->pts +
+ PTS_32_PATTERN_DURATION;
break;
case PTS_22_PATTERN:
if (pre_pts_trace != 2)
pattern_range = PTS_22_PATTERN_DETECT_RANGE;
expected_prev_interval = 2;
expected_curr_interval = 2;
+ if (!next_vf_nextpts)
+ next_vf_nextpts = next_vf->pts +
+ PTS_22_PATTERN_DURATION;
break;
case PTS_41_PATTERN:
/* TODO */
if (/*((int)(nextPts + expected_prev_interval * */
/*vsync_pts_inc - next_vf->next_vf_pts) < 0) && */
((int)(nextPts + (expected_prev_interval + 1) *
- vsync_pts_inc - next_vf->next_vf_pts) >= 0)) {
+ vsync_pts_inc - next_vf_nextpts) >= 0)) {
*expired = false;
if (pts_log_enable[PTS_32_PATTERN]
|| pts_log_enable[PTS_22_PATTERN])
>= 0) &&
((int)(nextPts +
vsync_pts_inc * (expected_prev_interval - 1)
- - next_vf->next_vf_pts) < 0) &&
+ - next_vf_nextpts) < 0) &&
((int)(nextPts + expected_prev_interval *
- vsync_pts_inc - next_vf->next_vf_pts) >= 0)) {
+ vsync_pts_inc - next_vf_nextpts) >= 0)) {
*expired = true;
if (pts_log_enable[PTS_32_PATTERN]
|| pts_log_enable[PTS_22_PATTERN])