Ticket #8564: 8564.patch

File 8564.patch, 3.8 KB (added by Jim Stichnoth <stichnot@…>, 16 years ago)
  • libs/libmythtv/deletemap.cpp

     
    7171{
    7272    if (!osd || !ctx)
    7373        return;
    74     CleanMap(total);
     74    //CleanMap(total);
    7575
    7676    InfoMap infoMap;
    7777    ctx->LockPlayingInfo(__FILE__, __LINE__);
     
    162162        int type = Delete(it.key());
    163163        Add(it.key(), type == MARK_CUT_END ? MARK_CUT_START : MARK_CUT_END);
    164164    }
    165     CleanMap(total);
     165    //CleanMap(total);
    166166}
    167167
    168168/**
     
    177177       ((MARK_CUT_START != type) && (MARK_CUT_END != type)))
    178178        return;
    179179
     180#if 0
    180181    int       lasttype  = MARK_UNSET;
    181182    long long lastframe = -1;
    182183    long long remove    = -1;
     
    224225
    225226    if (remove > -1)
    226227        Delete((uint64_t)remove);
     228#endif // 0
    227229    Add(frame, type);
    228     CleanMap(total);
     230    //CleanMap(total);
    229231}
    230232
    231233/// Remove the mark at the given frame.
     
    233235{
    234236    EDIT_CHECK
    235237    Delete(frame);
    236     CleanMap(total);
     238    //CleanMap(total);
    237239}
    238240
    239241/// Reverse the direction of the mark at the given frame.
     
    387389            uint64_t thisframe = it.key();
    388390            if (lasttype == thistype)
    389391            {
    390                 Delete(thistype == MARK_CUT_END ? thisframe :
     392                Delete(thistype == MARK_CUT_START ? thisframe :
    391393                                                  (uint64_t)lastframe);
    392394                clear = false;
    393395                break;
  • libs/libmythtv/osd.cpp

     
    429429    long long start = -1;
    430430    long long end   = -1;
    431431    bool first = true;
     432    QVector<float> pendingStarts;
     433    int i;
    432434    QMapIterator<uint64_t, MarkTypes> it(map);
    433435    while (it.hasNext())
    434436    {
    435         bool error = false;
    436437        it.next();
    437438        if (it.value() == MARK_CUT_START)
    438439        {
    439440            start = it.key();
    440             if (end > -1)
    441                 error = true;
     441            pendingStarts += start;
    442442        }
    443443        else if (it.value() == MARK_CUT_END)
    444444        {
    445445            if (first)
    446446                start = 0;
    447             if (start < 0)
    448                 error = true;
    449447            end = it.key();
     448            if (pendingStarts.isEmpty())
     449                pendingStarts += start;
     450            for (i=0; i<pendingStarts.size(); i++)
     451                bar->AddRegion((float)(pendingStarts[i]/(double)total),
     452                               (float)(end/(double)total));
     453            pendingStarts.clear();
    450454        }
    451455        first = false;
    452 
    453         if (error)
    454         {
    455             VERBOSE(VB_IMPORTANT, LOC_ERR + "deleteMap discontinuity");
    456             start = -1;
    457             end   = -1;
    458         }
    459 
    460         if (start >=0 && end >= 0)
    461         {
    462             bar->AddRegion((float)((double)start/(double)total),
    463                            (float)((double)end/(double)total));
    464             start = -1;
    465             end   = -1;
    466         }
    467456    }
    468     if (start > -1 && end < 0)
    469         bar->AddRegion((float)((double)start/(double)total), 1.0f);
     457    for (i=0; i<pendingStarts.size(); i++)
     458        bar->AddRegion((float)(pendingStarts[i]/(double)total), 1.0f);
    470459
    471460    bar->Display();
    472461}
  • libs/libmythui/mythuieditbar.cpp

     
    247247        }
    248248        else
    249249        {
    250             m_invregions.append(qMakePair(start, region.first));
     250            if (region.first > start)
     251                m_invregions.append(qMakePair(start, region.first));
    251252            start = region.second;
    252253        }
    253254    }