Ticket #3986: 3986-test-1.patch

File 3986-test-1.patch, 1.7 KB (added by danielk, 17 years ago)

testing patch

  • libs/libmythtv/guidegrid.cpp

     
    5656        qApp->unlock();
    5757
    5858        while (gg->isVisible())
    59             usleep(50);
     59            usleep(5000);
    6060    }
    6161    else
    6262        gg->exec();
  • libs/libmythtv/videoout_xv.cpp

     
    29822982        gl_context->SwapBuffers();
    29832983    }
    29842984
     2985    uint64_t startt, endt;
     2986    rdtsc(startt);
    29852987    X11S(XSync(XJ_disp, False));
     2988    rdtsc(endt);
     2989    if (endt > startt)
     2990        cout<<(endt-startt)<<":";
    29862991}
    29872992
    29882993void VideoOutputXv::ShowPip(VideoFrame *frame, NuppelVideoPlayer *pipplayer)
  • libs/libmyth/util.h

     
    7878MPUBLIC QString createTempFile(QString name_template = "/tmp/mythtv_XXXXXX",
    7979                               bool dir = false);
    8080
     81// CPU Tick timing function
     82#ifdef MMX
     83#ifdef _WIN32
     84typedef LONGLONG uint64_t
     85inline void rdtsc(uint64_t &x)
     86{
     87    QueryPerformanceCounter((LARGE_INTEGER*)(&x));
     88}
     89#else
     90typedef struct {
     91    uint a;
     92    uint b;
     93} timing_ab_t;
     94inline void rdtsc(uint64_t &x)
     95{
     96    timing_ab_t &y = (timing_ab_t&) x;
     97    asm("rdtsc \n"
     98        "mov %%eax, %0 \n"
     99        "mov %%edx, %1 \n"
     100        :
     101        : "m"(y.a), "m"(y.b)
     102        : "%eax", "%edx");
     103}
     104#endif
     105
     106#else // if !MMX
     107inline void rdtsc(uint64_t &x) { x = 0ULL; }
     108#endif // !MMX
     109
    81110#endif // UTIL_H_