Ticket #8564: 8564_v3.patch
File 8564_v3.patch, 4.7 KB (added by , 14 years ago) |
---|
-
libs/libmythtv/deletemap.cpp
71 71 { 72 72 if (!osd || !ctx) 73 73 return; 74 CleanMap(total);74 //CleanMap(total); 75 75 76 76 InfoMap infoMap; 77 77 ctx->LockPlayingInfo(__FILE__, __LINE__); … … 162 162 int type = Delete(it.key()); 163 163 Add(it.key(), type == MARK_CUT_END ? MARK_CUT_START : MARK_CUT_END); 164 164 } 165 CleanMap(total);165 //CleanMap(total); 166 166 } 167 167 168 168 /** … … 177 177 ((MARK_CUT_START != type) && (MARK_CUT_END != type))) 178 178 return; 179 179 180 #if 0 180 181 int lasttype = MARK_UNSET; 181 182 long long lastframe = -1; 182 183 long long remove = -1; … … 224 225 225 226 if (remove > -1) 226 227 Delete((uint64_t)remove); 228 #endif // 0 227 229 Add(frame, type); 228 CleanMap(total);230 //CleanMap(total); 229 231 } 230 232 231 233 /// Remove the mark at the given frame. … … 233 235 { 234 236 EDIT_CHECK 235 237 Delete(frame); 236 CleanMap(total);238 //CleanMap(total); 237 239 } 238 240 239 241 /// Reverse the direction of the mark at the given frame. … … 387 389 uint64_t thisframe = it.key(); 388 390 if (lasttype == thistype) 389 391 { 390 Delete(thistype == MARK_CUT_ END? thisframe :392 Delete(thistype == MARK_CUT_START ? thisframe : 391 393 (uint64_t)lastframe); 392 394 clear = false; 393 395 break; -
libs/libmythtv/osd.cpp
461 461 long long start = -1; 462 462 long long end = -1; 463 463 bool first = true; 464 QVector<float> pendingStarts; 465 int i; 464 466 QMapIterator<uint64_t, MarkTypes> it(map); 465 467 while (it.hasNext()) 466 468 { 467 bool error = false;468 469 it.next(); 469 470 if (it.value() == MARK_CUT_START) 470 471 { 471 472 start = it.key(); 472 if (end > -1) 473 error = true; 473 if (start > total) 474 start = total; 475 pendingStarts += start; 474 476 } 475 477 else if (it.value() == MARK_CUT_END) 476 478 { 477 479 if (first) 478 480 start = 0; 479 if (start < 0)480 error = true;481 481 end = it.key(); 482 if (end > total) 483 end = total; 484 if (pendingStarts.isEmpty()) 485 pendingStarts += start; 486 for (i=0; i<pendingStarts.size(); i++) 487 bar->AddRegion((float)(pendingStarts[i]/(double)total), 488 (float)(end/(double)total)); 489 pendingStarts.clear(); 482 490 } 483 491 first = false; 484 485 if (error)486 {487 VERBOSE(VB_IMPORTANT, LOC_ERR + "deleteMap discontinuity");488 start = -1;489 end = -1;490 }491 492 if (start >=0 && end >= 0)493 {494 bar->AddRegion((float)((double)start/(double)total),495 (float)((double)end/(double)total));496 start = -1;497 end = -1;498 }499 492 } 500 if (start > -1 && end < 0)501 bar->AddRegion((float)( (double)start/(double)total), 1.0f);493 for (i=0; i<pendingStarts.size(); i++) 494 bar->AddRegion((float)(pendingStarts[i]/(double)total), 1.0f); 502 495 503 496 bar->Display(); 504 497 } -
libs/libmythui/mythuieditbar.cpp
130 130 QPair<float,float> region = regions.next(); 131 131 int left = (int)((region.first * cutarea.width()) + 0.5f); 132 132 int right = (int)((region.second * cutarea.width()) + 0.5f); 133 if (left >= right) 134 right = left + 1; 133 135 if (cut) 134 136 { 135 137 AddBar(barshape, barimage, QRect(left, cutarea.top(), right - left, … … 158 160 QPair<float,float> region = regions2.next(); 159 161 int left = (int)((region.first * keeparea.width()) + 0.5f); 160 162 int right = (int)((region.second * keeparea.width()) + 0.5f); 163 if (left >= right) 164 right = left + 1; 161 165 if (keep) 162 166 { 163 167 AddBar(barshape, barimage, QRect(left, keeparea.top(), right - left, … … 250 254 } 251 255 else 252 256 { 253 m_invregions.append(qMakePair(start, region.first)); 257 if (region.first > start) 258 m_invregions.append(qMakePair(start, region.first)); 254 259 start = region.second; 255 260 } 256 261 }