summaryrefslogtreecommitdiff
path: root/src/xine-engine/metronom.c
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2002-02-16 23:37:55 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2002-02-16 23:37:55 +0000
commit0af75ff223f83bac429856099c67819b2b877c70 (patch)
tree0b0eafe24e5d37c4289d49d0a5556982bf6d1ef9 /src/xine-engine/metronom.c
parentf030f9e939d8949d43a6a4c11fc1e7c16617ca8d (diff)
downloadxine-lib-0af75ff223f83bac429856099c67819b2b877c70.tar.gz
xine-lib-0af75ff223f83bac429856099c67819b2b877c70.tar.bz2
bufixes from miguel freitas
CVS patchset: 1500 CVS date: 2002/02/16 23:37:55
Diffstat (limited to 'src/xine-engine/metronom.c')
-rw-r--r--src/xine-engine/metronom.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c
index 8dd7d81f3..c2c628c45 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.53 2002/02/09 07:13:24 guenter Exp $
+ * $Id: metronom.c,v 1.54 2002/02/16 23:37:55 guenter Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -49,6 +49,7 @@
#define METRONOM_REPORT
+
#define METRONOM_LOG
@@ -132,6 +133,8 @@ static void unixscr_start (scr_plugin_t *scr, int64_t start_vpts) {
this->cur_pts = start_vpts;
pthread_mutex_unlock (&this->lock);
+
+ unixscr_set_speed (&this->scr, SPEED_NORMAL);
}
static int64_t unixscr_get_current (scr_plugin_t *scr) {
@@ -166,9 +169,10 @@ static scr_plugin_t* unixscr_init () {
this->scr.adjust = unixscr_adjust;
this->scr.start = unixscr_start;
this->scr.get_current = unixscr_get_current;
- unixscr_set_speed (&this->scr, SPEED_NORMAL);
-
+
pthread_mutex_init (&this->lock, NULL);
+
+ unixscr_set_speed (&this->scr, SPEED_PAUSE);
return &this->scr;
}
@@ -417,7 +421,8 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) {
if (abs (diff) > VIDEO_DRIFT_TOLERANCE) {
this->video_vpts = vpts;
- this->video_wrap_offset = vpts - pts;
+ /* following line is useless (wrap_offset=wrap_offset) */
+ /* this->video_wrap_offset = vpts - pts; */
#ifdef METRONOM_LOG
printf ("metronom: video jump, wrap offset is now %lld\n",
@@ -427,7 +432,8 @@ static void metronom_got_video_frame (metronom_t *this, vo_frame_t *img) {
} else if (diff) {
this->video_vpts -= diff / 8; /* FIXME: better heuristics ? */
- this->video_wrap_offset = vpts - pts;
+ /* make wrap_offset consistent with the drift correction */
+ this->video_wrap_offset = this->video_vpts - pts;
#ifdef METRONOM_LOG
printf ("metronom: video drift, wrap offset is now %lld\n",