Ticket #1043: mythdvd_cleanup3.patch

File mythdvd_cleanup3.patch, 957 bytes (added by skamithi@…, 20 years ago)

use dvdnav_convert_time for calculating dvd time since it's available. didn't notice it before.

  • libs/libmythtv/DVDRingBuffer.cpp

     
    811811
    812812uint DVDRingBufferPriv::GetCurrentTime(void)
    813813{
    814     // Macro to convert Binary Coded Decimal to Decimal
    815     // Obtained from VLC Code.
    816     #define BCD2D(__x__) (((__x__ & 0xf0) >> 4) * 10 + (__x__ & 0x0f))
    817 
    818814    dsi_t *dvdnavDsi = dvdnav_get_current_nav_dsi(dvdnav);
    819815    dvd_time_t timeFromCellStart = dvdnavDsi->dsi_gi.c_eltm;
    820     uint8_t hours = BCD2D(timeFromCellStart.hour);
    821     uint8_t minutes = BCD2D(timeFromCellStart.minute);
    822     uint8_t seconds = BCD2D(timeFromCellStart.second);
    823     uint currentTime = GetCellStart() + (hours * 3600) + (minutes * 60) + seconds;
     816    uint currentTime = GetCellStart() +
     817        (uint)(dvdnav_convert_time(&timeFromCellStart) / 90000);
    824818    return currentTime;
    825819}
    826820