Add explanatory comments to the #endif part of multiple inclusion guards.
[mplayer/greg.git] / stream / stream_dvd_common.c
blob895db3a567bad77fd064716a9221eae114f517b4
1 #include <inttypes.h>
2 #include <dvdread/ifo_types.h>
3 #include "stream_dvd_common.h"
5 /**
6 \brief Converts DVD time structure to milliseconds.
7 \param *dev the DVD time structure to convert
8 \return returns the time in milliseconds
9 */
10 int mp_dvdtimetomsec(dvd_time_t *dt)
12 static int framerates[4] = {0, 2500, 0, 2997};
13 int framerate = framerates[(dt->frame_u & 0xc0) >> 6];
14 int msec = (((dt->hour & 0xf0) >> 3) * 5 + (dt->hour & 0x0f)) * 3600000;
15 msec += (((dt->minute & 0xf0) >> 3) * 5 + (dt->minute & 0x0f)) * 60000;
16 msec += (((dt->second & 0xf0) >> 3) * 5 + (dt->second & 0x0f)) * 1000;
17 if(framerate > 0)
18 msec += (((dt->frame_u & 0x30) >> 3) * 5 + (dt->frame_u & 0x0f)) * 100000 / framerate;
19 return msec;