Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorUnderground78 <underground78@users.sourceforge.net>2013-10-15 23:58:44 +0400
committerUnderground78 <underground78@users.sourceforge.net>2013-10-16 22:52:56 +0400
commitfa15b279f397141ebda7e908e9e323941d883523 (patch)
treef3dfafae3b6b418ec4cc48d141c8be3cdb015324 /src
parentb0d48613e1aaf9a80145b10e31105102c361a900 (diff)
Skip to previous chapter: Use the same threshold for files and DVDs.
Previously thresholds of 3 seconds and 7 seconds were used respectively for files and DVDs, to choose between restarting a chapter or skipping to the previous one. Now both uses a 5 second threshold.
Diffstat (limited to 'src')
-rw-r--r--src/mpc-hc/MainFrm.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mpc-hc/MainFrm.cpp b/src/mpc-hc/MainFrm.cpp
index ea009b665..55b053258 100644
--- a/src/mpc-hc/MainFrm.cpp
+++ b/src/mpc-hc/MainFrm.cpp
@@ -104,6 +104,8 @@ bool NEARLY_EQ(T a, T b, T tol)
#define MENUBARBREAK 30
+#define PREV_CHAP_THRESHOLD 5
+
static UINT s_uTaskbarRestart = RegisterWindowMessage(_T("TaskbarCreated"));
static UINT WM_NOTIFYICON = RegisterWindowMessage(_T("MYWM_NOTIFYICON"));
static UINT s_uTBBC = RegisterWindowMessage(_T("TaskbarButtonCreated"));
@@ -8261,9 +8263,9 @@ bool CMainFrame::SeekToFileChapter(int iChapter, bool bRelative /*= false*/)
if (bRelative) {
if (SUCCEEDED(m_pMS->GetCurrentPosition(&rt))) {
if (iChapter < 0) {
- // If we are less than 3s after the start of the current chapter, we go to
- // the previous chapter else we restart current chapter from the beginning
- rt -= 30000000;
+ // Go the previous chapter only if more than PREV_CHAP_THRESHOLD seconds
+ // have passed since the beginning of the current chapter else restart it
+ rt -= PREV_CHAP_THRESHOLD * 10000000;
iChapter = 0;
} else if (iChapter > 0) {
iChapter = 1;
@@ -8326,9 +8328,9 @@ bool CMainFrame::SeekToDVDChapter(int iChapter, bool bRelative /*= false*/)
if (m_lChapterStartTime != 0xFFFFFFFF && tsec > m_lChapterStartTime) {
diff = tsec - m_lChapterStartTime;
}
- // Go the previous chapter only if else than 7 seconds
- // have passed since the beginning of the current chapter
- if (diff <= 7) {
+ // Go the previous chapter only if more than PREV_CHAP_THRESHOLD seconds
+ // have passed since the beginning of the current chapter else restart it
+ if (diff <= PREV_CHAP_THRESHOLD) {
// If we are at the first chapter of a volume that isn't the first
// one, we skip to the last chapter of the previous volume.
if (uChapter == 1 && uTitle > 1) {