MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / dvdtime2msec

Function dvdtime2msec

libhb/dvdnav.c:2026–2042  ·  view source on GitHub ↗

* dvdtime2msec *********************************************************************** * From lsdvd **********************************************************************/

Source from the content-addressed store, hash-verified

2024 * From lsdvd
2025 **********************************************************************/
2026static int dvdtime2msec(dvd_time_t * dt)
2027{
2028 double frames_per_s[4] = {-1.0, 25.00, -1.0, 29.97};
2029 double fps = frames_per_s[(dt->frame_u & 0xc0) >> 6];
2030 long ms;
2031 ms = (((dt->hour & 0xf0) >> 3) * 5 + (dt->hour & 0x0f)) * 3600000;
2032 ms += (((dt->minute & 0xf0) >> 3) * 5 + (dt->minute & 0x0f)) * 60000;
2033 ms += (((dt->second & 0xf0) >> 3) * 5 + (dt->second & 0x0f)) * 1000;
2034
2035 if( fps > 0 )
2036 {
2037 ms += (((dt->frame_u & 0x30) >> 3) * 5 +
2038 (dt->frame_u & 0x0f)) * 1000.0 / fps;
2039 }
2040
2041 return ms;
2042}
2043
2044static int TitleOpenIfo(hb_dvdnav_t * d, int t)
2045{

Callers 2

PttDurationFunction · 0.70
TitleOpenIfoFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected