[mythtv-commits] Ticket #13392: Incorrect time conversion in dvbchannel.cpp
MythTV
noreply at mythtv.org
Mon Jan 28 15:41:41 UTC 2019
#13392: Incorrect time conversion in dvbchannel.cpp
---------------------------------+--------------------------
Reporter: Klaas de Waal | Owner: (none)
Type: Patch - Bug Fix | Status: new
Priority: trivial | Milestone: needs_triage
Component: MythTV - DVB | Version: Master Head
Severity: low | Keywords: DVB timeout
Ticket locked: 0 |
---------------------------------+--------------------------
Function wait_for_backend in dvbchannel.cpp has a time value in
milliseconds in the second parameter. This value is converted from integer
to struct timeval.\\
A struct timeval consists of a number of seconds plus a number of
microseconds, as defined in /usr/include/bits/types/struct_timeval.h of
Fedora 29:
{{{
#ifndef __timeval_defined
#define __timeval_defined 1
#include <bits/types.h>
/* A time value that is accurate to the nearest
microsecond but also has a range of years. */
struct timeval
{
__time_t tv_sec; /* Seconds. */
__suseconds_t tv_usec; /* Microseconds. */
};
#endif
}}}
The code in wait_for_backed does compute the number of microseconds but
the number of seconds is set to zero. This is only correct if the value of
parameter timeout_ms is less than 1000.\\
The attached patch does also compute the number of seconds.\\
Note that the existing code does not yet give any problems; the function
wait_for_backend is called only from one place with a value of 50
milliseconds.
--
Ticket URL: <https://code.mythtv.org/trac/ticket/13392>
MythTV <http://www.mythtv.org>
MythTV Media Center
More information about the mythtv-commits
mailing list