Ticket #2903: mythtv-0.21-interlaced-display-rate.2.patch

File mythtv-0.21-interlaced-display-rate.2.patch, 1.1 KB (added by Tom Dexter <digitalaudiorock@…>, 11 years ago)

New patch for 0.21-fixes

  • libs/libmythtv/videoout_xv.cpp

     
    6767#define round(x) ((int) ((x) + 0.5))
    6868#endif
    6969
     70#ifndef V_INTERLACE
     71#define V_INTERLACE (0x010)
     72#endif
     73
    7074#ifndef XVMC_CHROMA_FORMAT_420
    7175#define XVMC_CHROMA_FORMAT_420 0x00000001
    7276#endif
     
    365369
    366370    rate = (dot_clock * 1000.0) / rate;
    367371
     372    // For an interlaced display mode, we want the refresh rate to be the field
     373    // rate, so that we can use an x2 deinterlacer. It may be the case that some
     374    // drivers (possibly openchrome) use false mode lines, with a doubled clock
     375    // rate, so as to make the frame rate calculation produce the field rate.
     376    // We check for 25 or 30 to avoid twice doubling in that case.
     377    if (((mode_line.flags & V_INTERLACE) != 0) &&
     378        rate > 24.5 && rate < 30.5)
     379    {
     380        VERBOSE(VB_GENERAL, "Doubling refresh rate for interlaced display mode");
     381
     382        rate *= 2;
     383    }
     384
    368385    // Assume 60Hz if rate isn't good:
    369386    if (rate < 20 || rate > 200)
    370387    {