view stream/stream_dvd_common.c @ 27074:242ff412c591

Only "pop" subtree params if they had previously been "pushed", and afterwards reset the "pushed" value to 0 again. Similarly only set the PLAY_TREE_RND_PLAYED flag if the entry had been pushed before.
author ben
date Fri, 20 Jun 2008 19:51:43 +0000
parents f0d0b666ee35
children e7c989f7a7c9
line wrap: on
line source

#include "config.h"
#include <inttypes.h>
#ifdef USE_DVDREAD_INTERNAL
#include <dvdread/ifo_types.h>
#else
#include <libdvdread/ifo_types.h>
#endif
#include "stream_dvd_common.h"

/** 
\brief Converts DVD time structure to milliseconds.
\param *dev the DVD time structure to convert
\return returns the time in milliseconds
*/
int mp_dvdtimetomsec(dvd_time_t *dt)
{
  static int framerates[4] = {0, 2500, 0, 2997};
  int framerate = framerates[(dt->frame_u & 0xc0) >> 6];
  int msec = (((dt->hour & 0xf0) >> 3) * 5 + (dt->hour & 0x0f)) * 3600000;
  msec += (((dt->minute & 0xf0) >> 3) * 5 + (dt->minute & 0x0f)) * 60000;
  msec += (((dt->second & 0xf0) >> 3) * 5 + (dt->second & 0x0f)) * 1000;
  if(framerate > 0)
    msec += (((dt->frame_u & 0x30) >> 3) * 5 + (dt->frame_u & 0x0f)) * 100000 / framerate;
  return msec;
}