Opened 14 years ago

Closed 14 years ago

#3542 closed defect (fixed)

Stuttering playback due to bad refresh rate detection.

Reported by: anonymous Owned by: Nigel
Priority: minor Milestone: unknown
Component: mythtv Version: head
Severity: medium Keywords: playback refresh rate
Cc: Ticket locked: no


Some video drivers like Openchrome in VBE mode can return modelines with only zeros. This causes a divide by zero in the refresh rate calculation in videoout_xv.cpp and the playback part tries to use NaN as reference. This results in stuttering, unwatchable playback.

The patch checks if there will be a divide by zero and defaults to 60Hz if this is the case. I checked the patch with the real refresh rate of my monitor, I'm not sure what happens if there's a difference in myth/real refresh rate. Best would be to have a more reliable way to detect the refresh rate if this value is really critical.

Attachments (1)

refresh-only.diff (1.1 KB) - added by dvbmail@… 14 years ago.
Patch to fix refresh rate detection.

Download all attachments as: .zip

Change History (5)

Changed 14 years ago by dvbmail@…

Attachment: refresh-only.diff added

Patch to fix refresh rate detection.

comment:1 Changed 14 years ago by Nigel

Owner: changed from Isaac Richards to Nigel
Status: newassigned

Thanks for the patch, XXXXXXX. I have simplified your patch slightly (pre-store the multiplication, maybe faster if the compiler doesn't already optimise it):

-    double rate = (double)((double)(dot_clock * 1000.0) /
-                           (double)(mode_line.htotal * mode_line.vtotal));
+    double rate = mode_line.htotal * mode_line.vtotal;
+    // See if there's valid data to prevent a divide by zero. 
+    if (rate > 0)
+        rate = (dot_clock * 1000.0) / rate;

Assuming this doesn't cause new bugs, will commit in a day or two.

comment:2 Changed 14 years ago by Nigel

Sorry, that was meant to be "Thanks for the patch, Christiaan" :-)

comment:3 Changed 14 years ago by Nigel

(In [14032]) Check for divide by zero, update doco. See #3542

comment:4 Changed 14 years ago by Nigel

Resolution: fixed
Status: assignedclosed

(In [14033]) heck for divide by zero, update doco. Closes #3542

Note: See TracTickets for help on using tickets.