Ticket #3476: mergecomm.diff
File mergecomm.diff, 2.9 KB (added by , 17 years ago) |
---|
-
libs/libmythtv/NuppelVideoPlayer.cpp
5715 5715 } 5716 5716 } 5717 5717 5718 void NuppelVideoPlayer::MergeShortCommercials(void) 5719 { 5720 double maxMerge = gContext->GetNumSetting("MergeShortCommBreaks", 0) * 5721 video_frame_rate; 5722 if (maxMerge > 0) 5723 { 5724 long long lastFrame = commBreakIter.key(); 5725 ++commBreakIter; 5726 while ((commBreakIter != commBreakMap.end()) && 5727 (commBreakIter.key() - lastFrame < maxMerge)) { 5728 ++commBreakIter; 5729 } 5730 --commBreakIter; 5731 } 5732 } 5733 5718 5734 void NuppelVideoPlayer::AutoCommercialSkip(void) 5719 5735 { 5720 5736 if (((time(NULL) - lastSkipTime) <= 2) || … … 5746 5762 .arg(framesPlayed).arg(commBreakIter.key())); 5747 5763 5748 5764 ++commBreakIter; 5765 5766 MergeShortCommercials(); 5767 5749 5768 if (commBreakIter == commBreakMap.end()) 5750 5769 { 5751 5770 VERBOSE(VB_COMMFLAG, LOC + "AutoCommercialSkip(), at " … … 5952 5971 } 5953 5972 } 5954 5973 5974 if (direction > 0) 5975 MergeShortCommercials(); 5976 5955 5977 if (osd) 5956 5978 { 5957 5979 int skipped_seconds = (int)((commBreakIter.key() - -
libs/libmythtv/NuppelVideoPlayer.h
453 453 void SkipCommercialsByBlanks(void); 454 454 bool DoSkipCommercials(int direction); 455 455 void AutoCommercialSkip(void); 456 void MergeShortCommercials(void); 456 457 457 458 // Private edit stuff 458 459 void SaveCutList(void); -
programs/mythfrontend/globalsettings.cpp
518 518 return bs; 519 519 } 520 520 521 static GlobalSpinBox *MergeShortCommBreaks() 522 { 523 GlobalSpinBox *bs = new GlobalSpinBox("MergeShortCommBreaks", 0, 3600, 5); 524 bs->setLabel(QObject::tr("Merge short commercial breaks (in seconds)")); 525 bs->setHelpText(QObject::tr("Treat consecutive commercial breaks shorter " 526 "than this as one break when skipping forward. Useful if " 527 "you have to skip a few times during breaks. Applies to " 528 "automatic skipping as well. Set to 0 to disable.")); 529 bs->setValue(0); 530 return bs; 531 } 521 532 522 533 static GlobalSpinBox *AutoExpireExtraSpace() 523 534 { … … 3575 3586 comms->addChild(CommRewindAmount()); 3576 3587 comms->addChild(CommNotifyAmount()); 3577 3588 comms->addChild(MaximumCommercialSkip()); 3589 comms->addChild(MergeShortCommBreaks()); 3578 3590 comms->addChild(CommSkipAllBlanks()); 3579 3591 addChild(comms);