Ticket #1842: cn400.diff

File cn400.diff, 3.8 KB (added by teague@…, 18 years ago)

Quick patch to make HD hardware decoding work on my CN400

  • libs/libmythtv/NuppelVideoPlayer.cpp

     
    8484#endif
    8585
    8686#define FAST_RESTART 0
     87
     88#define MIN_USLEEP ((1000000 / 1000) + 500)
     89
    8790#define LOC QString("NVP: ")
    8891#define LOC_ERR QString("NVP, Error: ")
    8992
     
    31033106        // If mythyv/mythfrontend was installed SUID root, this will work.
    31043107#ifndef CONFIG_DARWIN
    31053108        gContext->addPrivRequest(MythPrivRequest::MythRealtime, &output_video);
    3106 #endif
    31073109
    31083110        // Use realtime prio for decoder thread as well
    3109         //gContext->addPrivRequest(MythPrivRequest::MythRealtime, &decoder_thread);
    3110     }
     3111        gContext->addPrivRequest(MythPrivRequest::MythRealtime, &decoder_thread);
     3112#endif
    31113113
     3114    }
     3115
    31123116    if (bookmarkseek > 30)
    31133117    {
    31143118        GetFrame(audioOutput == NULL || !normal_speed);
  • libs/libmythtv/videoout_xv.cpp

     
    695695        myth2av_codecid(myth_codec_id, vld, idct, mc);
    696696
    697697        if (vld)
    698             xvmc_buf_attr->SetNumSurf(16);
     698            xvmc_buf_attr->SetNumSurf(12);
    699699
    700700        vbuffers.Init(xvmc_buf_attr->GetNumSurf(),
    701701                      false /* create an extra frame for pause? */,
     
    13581358    XvMCContext *ctx = new XvMCContext;
    13591359    X11S(ret = XvMCCreateContext(disp, port, surf_type, width, height,
    13601360                                 XVMC_DIRECT, ctx));
     1361
     1362    VERBOSE(VB_PLAYBACK, LOC + QString("XvMCCreateContext: '%1'")
     1363            .arg(ret));
     1364
    13611365    if (ret != Success)
    13621366    {
    13631367        VERBOSE(VB_IMPORTANT, LOC_ERR +
     
    13971401
    13981402    bool createBlocks = !(XVMC_VLD == (xvmc_surf_info.mc_type & XVMC_VLD));
    13991403    xvmc_surfs = CreateXvMCSurfaces(xvmc_buf_attr->GetMaxSurf(), createBlocks);
     1404
     1405    VERBOSE(VB_PLAYBACK, LOC + QString("Num surfaces: '%1'")
     1406            .arg(xvmc_surfs.size()));
     1407
    14001408    if (xvmc_surfs.size() < xvmc_buf_attr->GetMinSurf())
    14011409    {
    14021410        VERBOSE(VB_IMPORTANT, LOC_ERR + "Unable to create XvMC Surfaces");
  • libs/libmythtv/util-xvmc.h

     
    5353        num_xvmc_surf(1),
    5454        needed_for_display(1),
    5555        min_num_xvmc_surfaces(8),
    56         max_num_xvmc_surfaces(16),
     56        max_num_xvmc_surfaces(12),
    5757        num_xvmc_surfaces(min_num_xvmc_surfaces),
    58         aggressive(false) {}
     58        aggressive(true) {}
    5959
    6060    void SetOSDNum(uint val)
    6161    {
  • programs/mythfrontend/main.cpp

     
    695695                            .arg(getuid()).arg(geteuid()));
    696696
    697697    (void)data;
     698
     699    int thread_prio = 1;
     700
    698701    while (true)
    699702    {
    700703        gContext->waitPrivRequest();
     
    710713                {
    711714                    pthread_t *target_thread = (pthread_t *)(req.getData());
    712715                    // Raise the given thread to realtime priority
    713                     struct sched_param sp = {1};
     716                    struct sched_param sp = {thread_prio};
     717                    thread_prio++;
    714718                    if (target_thread)
    715719                    {
    716720                        int status = pthread_setschedparam(
    717                             *target_thread, SCHED_FIFO, &sp);
     721                            *target_thread, SCHED_RR, &sp);
    718722                        if (status)
    719723                        {
    720724                            // perror("pthread_setschedparam");