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

File mythtv-0.21-interlaced-display-rate.patch, 1.2 KB (added by mythtv@…, 11 years ago)

New patch

  • libs/libmythtv/videoout_xv.cpp

    diff -Naur mythtv-0.21-20088-old/libs/libmythtv/videoout_xv.cpp mythtv-0.21-20088-new/libs/libmythtv/videoout_xv.cpp
    old new  
    7272#define round(x) ((int) ((x) + 0.5))
    7373#endif
    7474
     75#ifndef V_INTERLACE
     76#define V_INTERLACE (0x010)
     77#endif
     78
    7579#ifndef XVMC_CHROMA_FORMAT_420
    7680#define XVMC_CHROMA_FORMAT_420 0x00000001
    7781#endif
     
    395399
    396400    rate = (dot_clock * 1000.0) / rate;
    397401
     402    // For an interlaced display mode, we want the refresh rate to be the field
     403    // rate, so that we can use an x2 deinterlacer. It may be the case that some
     404    // drivers (possibly openchrome) use false mode lines, with a doubled clock
     405    // rate, so as to make the frame rate calculation produce the field rate.
     406    // We check for 25 or 30 to avoid twice doubling in that case.
     407    if ((mode_line.flags & V_INTERLACE) != 0
     408        && rate == 25 || rate == 30)
     409    {
     410        VERBOSE(VB_GENERAL, "Doubling refresh rate for interlaced display mode");
     411
     412        rate *= 2;
     413    }
     414
    398415    // Assume 60Hz if rate isn't good:
    399416    if (rate < 20 || rate > 200)
    400417    {