summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Lampard <mlampard@users.sourceforge.net>2002-03-31 14:36:42 +0000
committerMike Lampard <mlampard@users.sourceforge.net>2002-03-31 14:36:42 +0000
commitd243ac5499433b23d55687fafaf52e33a5eab5ab (patch)
treee0de86609778bb37f824125a21b2a932e14b14d3
parent2f7bba0bd01b3814c7239a9907c4c652d7718cb8 (diff)
downloadxine-lib-d243ac5499433b23d55687fafaf52e33a5eab5ab.tar.gz
xine-lib-d243ac5499433b23d55687fafaf52e33a5eab5ab.tar.bz2
patches by Michael Roitzsch for dxr3 compatibility: introduce a new metronom
option deny_backward_adjust, which, when set, only allows positive adjustments to vpts_offset. CVS patchset: 1649 CVS date: 2002/03/31 14:36:42
-rw-r--r--src/xine-engine/audio_out.c11
-rw-r--r--src/xine-engine/metronom.c11
-rw-r--r--src/xine-engine/metronom.h11
3 files changed, 24 insertions, 9 deletions
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c
index 52e568339..52d5c46f3 100644
--- a/src/xine-engine/audio_out.c
+++ b/src/xine-engine/audio_out.c
@@ -17,7 +17,7 @@
* along with self program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_out.c,v 1.49 2002/03/26 01:47:17 miguelfreitas Exp $
+ * $Id: audio_out.c,v 1.50 2002/03/31 14:36:42 mlampard Exp $
*
* 22-8-2001 James imported some useful AC3 sections from the previous alsa driver.
* (c) 2001 Andy Lo A Foe <andy@alsaplayer.org>
@@ -344,8 +344,13 @@ static void *ao_loop (void *this_gen) {
cur_time > (last_sync_time + SYNC_TIME_INVERVAL) &&
bufs_since_sync >= SYNC_BUF_INTERVAL ) {
- this->metronom->set_option(this->metronom, METRONOM_ADJ_VPTS_OFFSET,
- -gap/SYNC_GAP_RATE );
+ if (!this->metronom->get_option(this->metronom, METRONOM_DENY_BACKWARD_ADJUST) ||
+ gap < 0) {
+ this->metronom->set_option(this->metronom, METRONOM_ADJ_VPTS_OFFSET,
+ -gap/SYNC_GAP_RATE );
+ } else {
+ ao_fill_gap(this, gap);
+ }
last_sync_time = cur_time;
bufs_since_sync = 0;
}
diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c
index 689274239..4f5b2b87d 100644
--- a/src/xine-engine/metronom.c
+++ b/src/xine-engine/metronom.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: metronom.c,v 1.76 2002/03/26 01:47:17 miguelfreitas Exp $
+ * $Id: metronom.c,v 1.77 2002/03/31 14:36:42 mlampard Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -521,11 +521,15 @@ static void metronom_set_option (metronom_t *this, int option, int64_t value) {
this->scr_adjustable = value;
break;
case METRONOM_ADJ_VPTS_OFFSET:
- this->vpts_offset += value;
+ if (!this->deny_backward_adjust || value > 0)
+ this->vpts_offset += value;
/*#ifdef LOG*/
printf ("metronom: adjusting vpts_offset by %lld\n", value );
/*#endif*/
break;
+ case METRONOM_DENY_BACKWARD_ADJUST:
+ this->deny_backward_adjust = value;
+ break;
default:
printf ("metronom: unknown option in set_option: %d\n",
option);
@@ -540,6 +544,8 @@ static int64_t metronom_get_option (metronom_t *this, int option) {
return this->av_offset;
case METRONOM_SCR_ADJUSTABLE:
return this->scr_adjustable;
+ case METRONOM_DENY_BACKWARD_ADJUST:
+ return this->deny_backward_adjust;
}
printf ("metronom: unknown option in get_option: %d\n",
option);
@@ -692,6 +698,7 @@ metronom_t * metronom_init (int have_audio, void *xine) {
this->in_discontinuity = 0;
this->vpts_offset = 0;
this->next_vpts_offset = 0;
+ this->deny_backward_adjust = 0;
/* initialize video stuff */
diff --git a/src/xine-engine/metronom.h b/src/xine-engine/metronom.h
index b49303a63..924efd5c3 100644
--- a/src/xine-engine/metronom.h
+++ b/src/xine-engine/metronom.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: metronom.h,v 1.26 2002/03/26 01:47:17 miguelfreitas Exp $
+ * $Id: metronom.h,v 1.27 2002/03/31 14:36:42 mlampard Exp $
*
* metronom: general pts => virtual calculation/assoc
*
@@ -226,6 +226,8 @@ struct metronom_s {
scr_plugin_t** scr_list;
pthread_t sync_thread;
int scr_adjustable;
+
+ int deny_backward_adjust;
pthread_mutex_t lock;
@@ -244,9 +246,10 @@ metronom_t *metronom_init (int have_audio, void *xine);
* metronom options
*/
-#define METRONOM_SCR_ADJUSTABLE 1
-#define METRONOM_AV_OFFSET 2
-#define METRONOM_ADJ_VPTS_OFFSET 3
+#define METRONOM_SCR_ADJUSTABLE 1
+#define METRONOM_AV_OFFSET 2
+#define METRONOM_ADJ_VPTS_OFFSET 3
+#define METRONOM_DENY_BACKWARD_ADJUST 4
/*
* SCR (system clock reference) plugins