Ticket #7067: patch2.txt

File patch2.txt, 2.4 KB (added by Davin McCall <davmac@…>, 10 years ago)

Patch to fix #7067

Line 
1Index: mythtv/libs/libmythtv/NuppelVideoPlayer.cpp
2===================================================================
3--- mythtv/libs/libmythtv/NuppelVideoPlayer.cpp (revision 22730)
4+++ mythtv/libs/libmythtv/NuppelVideoPlayer.cpp (working copy)
5@@ -1074,13 +1074,17 @@
6 
7     m_scan_locked = (scan != kScan_Detect);
8 
9-    if (scan == m_scan)
10+    if (scan == m_scan) {
11+        bool interlaced = m_deint_possible && is_interlaced(scan);
12+        videosync->SetFrameInterval(frame_interval, interlaced);
13         return;
14+    }
15 
16     bool interlaced = is_interlaced(scan);
17     if (interlaced && !m_deint_possible)
18     {
19         m_scan = scan;
20+        videosync->SetFrameInterval(frame_interval, false);
21         return;
22     }
23 
24@@ -1114,11 +1118,8 @@
25         if (kScan_Progressive == scan)
26         {
27             m_double_process = false;
28-            if (m_double_framerate)
29-            {
30-                m_double_framerate = false;
31-                videosync->SetFrameInterval(frame_interval, false);
32-            }
33+            m_double_framerate = false;
34+            videosync->SetFrameInterval(frame_interval, false);
35             videoOutput->SetDeinterlacingEnabled(false);
36             VERBOSE(VB_PLAYBACK, "Disabled deinterlacing");
37         }
38Index: mythtv/libs/libmythtv/vsync.cpp
39===================================================================
40--- mythtv/libs/libmythtv/vsync.cpp     (revision 22730)
41+++ mythtv/libs/libmythtv/vsync.cpp     (working copy)
42@@ -197,25 +197,15 @@
43 {
44     struct timeval now;
45     gettimeofday(&now, NULL);
46-    //cout << "CalcDelay: next: " << timeval_str(m_nexttrigger) << " now "
47-    // << timeval_str(now) << endl;
48         
49     int ret_val = (m_nexttrigger.tv_sec - now.tv_sec) * 1000000 +
50                   (m_nexttrigger.tv_usec - now.tv_usec);
51 
52-    //cout << "delay " << ret_val << endl;
53-
54-    if (ret_val > m_frame_interval * 2)
55-    {
56-        if (m_interlaced)
57-            ret_val = m_frame_interval; // same as / 2 * 2.
58-        else
59-            ret_val = m_frame_interval * 2;
60-
61-        // set nexttrigger to our new target time
62+    // We don't want to allow too much underflow. If
63+    // the trigger time is too far in the past, reset it now.
64+    if (ret_val < -m_frame_interval / 2) {
65         m_nexttrigger.tv_sec = now.tv_sec;
66         m_nexttrigger.tv_usec = now.tv_usec;
67-        OffsetTimeval(m_nexttrigger, ret_val);
68     }
69 
70     return ret_val;