summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.c4
-rw-r--r--config.h3
-rw-r--r--device.c25
-rw-r--r--setup_menu.c5
4 files changed, 25 insertions, 12 deletions
diff --git a/config.c b/config.c
index 1182a8cd..03da4d76 100644
--- a/config.c
+++ b/config.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: config.c,v 1.46 2007-09-17 17:56:26 phelin Exp $
+ * $Id: config.c,v 1.47 2007-09-30 16:52:18 phintuka Exp $
*
*/
@@ -489,6 +489,7 @@ config_t::config_t() {
#else
ibp_trickspeed = 0;
#endif
+ max_trickspeed = 12;
overscan = 0;
hue = -1;
saturation = -1;
@@ -712,6 +713,7 @@ bool config_t::SetupParse(const char *Name, const char *Value)
else if (!strcasecmp(Name, "Video.Brightness")) brightness = atoi(Value);
else if (!strcasecmp(Name, "Video.Overscan")) overscan = atoi(Value);
else if (!strcasecmp(Name, "Video.IBPTrickSpeed")) ibp_trickspeed = atoi(Value);
+ else if (!strcasecmp(Name, "Video.MaxTrickSpeed")) max_trickspeed = atoi(Value);
else if (!strcasecmp(Name, "Post.pp.Enable")) ffmpeg_pp = atoi(Value);
else if (!strcasecmp(Name, "Post.pp.Quality")) ffmpeg_pp_quality = atoi(Value);
diff --git a/config.h b/config.h
index a6716873..a7ccb3cf 100644
--- a/config.h
+++ b/config.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: config.h,v 1.30 2007-09-12 13:49:37 phintuka Exp $
+ * $Id: config.h,v 1.31 2007-09-30 16:52:18 phintuka Exp $
*
*/
@@ -201,6 +201,7 @@ class config_t {
// Video settings
int ibp_trickspeed;
+ int max_trickspeed;
int overscan; // %
int hue; // 0...0xffff, -1 == off
int saturation; // 0...0xffff, -1 == off
diff --git a/device.c b/device.c
index 288f6fba..a283ef64 100644
--- a/device.c
+++ b/device.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: device.c,v 1.42 2007-09-30 16:10:20 phintuka Exp $
+ * $Id: device.c,v 1.43 2007-09-30 16:52:18 phintuka Exp $
*
*/
@@ -776,6 +776,11 @@ void cXinelibDevice::TrickSpeed(int Speed)
RealSpeed = 12/Speed;
LOGTRICKSPEED(" Fast (%dx speed), direction unknown", RealSpeed);
+ if(RealSpeed > xc.max_trickspeed) {
+ RealSpeed = xc.max_trickspeed;
+ LOGTRICKSPEED(" Trick speed limited to %dx speed", RealSpeed);
+ }
+
/* only I-frames, backwards, pts must be re-generated if playing backwards */
m_TrickSpeedMode |= trs_PTS_check;
@@ -966,14 +971,16 @@ int cXinelibDevice::PlayTrickSpeed(const uchar *buf, int length)
static int64_t t0 = 0;
int64_t t1 = cTimeMs::Now();
if((t1 - t0) < 1000) {
- int fdelay = 40*12;
- if(m_TrickSpeed==6) fdelay /= 2;
- if(m_TrickSpeed==3) fdelay /= 4;
- if(m_TrickSpeed==1) fdelay /= 12;
- if(m_TrickSpeed==63) fdelay *= 6;
- if(m_TrickSpeed==48) fdelay *= 4;
- if(m_TrickSpeed==24) fdelay *= 2;
-
+ int fdelay = 40*12; // = 480 ms, time of one GOP in normal speed
+ switch(m_TrickSpeed) {
+ case 6: /* 2x ff */ fdelay /= min( 2, xc.max_trickspeed); break;
+ case 3: /* 4x ff */ fdelay /= min( 4, xc.max_trickspeed); break;
+ case 1: /* 12x ff */ fdelay /= min(12, xc.max_trickspeed); break;
+ case 63: /* 1/6x rew */ fdelay *= 6; break;
+ case 48: /* 1/4x rew */ fdelay *= 4; break;
+ case 24: /* 1/2x rew */ fdelay *= 2; break;
+ default: break;
+ }
/* wait if data is coming in too fast */
if(fdelay - (t1-t0) >= 40) {
m_TrickSpeedDelay = 40;
diff --git a/setup_menu.c b/setup_menu.c
index e7460dc5..5c3d9510 100644
--- a/setup_menu.c
+++ b/setup_menu.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: setup_menu.c,v 1.39 2007-09-18 14:02:38 phintuka Exp $
+ * $Id: setup_menu.c,v 1.40 2007-09-30 16:52:18 phintuka Exp $
*
*/
@@ -657,6 +657,8 @@ void cMenuSetupVideo::Set(void)
Add(new cMenuEditBoolItem(tr("Smooth fast forward"),
&newconfig.ibp_trickspeed));
#endif
+ Add(new cMenuEditIntItem(tr("Fastest trick speed"),
+ &newconfig.max_trickspeed, 1, 12));
if(current<1) current=1; /* first item is not selectable */
SetCurrent(Get(current));
@@ -755,6 +757,7 @@ void cMenuSetupVideo::Store(void)
SetupStore("Video.Brightness", xc.brightness);
SetupStore("Video.Overscan", xc.overscan);
SetupStore("Video.IBPTrickSpeed", xc.ibp_trickspeed);
+ SetupStore("Video.MaxTrickSpeed", xc.max_trickspeed);
SetupStore("Post.pp.Enable", xc.ffmpeg_pp);
SetupStore("Post.pp.Quality", xc.ffmpeg_pp_quality);
SetupStore("Post.pp.Mode", xc.ffmpeg_pp_mode);