From f15b4990dc0b6fbf3842641a856ee292a2f9777e Mon Sep 17 00:00:00 2001 From: Guenter Bartsch Date: Tue, 10 Jul 2001 22:16:58 +0000 Subject: metronom bugfix to handle pts start detection right CVS patchset: 267 CVS date: 2001/07/10 22:16:58 --- src/xine-engine/metronom.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c index bdea19b8e..d3ef4f40c 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.15 2001/07/08 18:15:54 guenter Exp $ + * $Id: metronom.c,v 1.16 2001/07/10 22:16:58 guenter Exp $ */ #ifdef HAVE_CONFIG_H @@ -306,6 +306,13 @@ static uint32_t metronom_got_video_frame (metronom_t *this, uint32_t pts) { this->video_stream_starting = 0; this->video_wrap_offset = -1 * pts; + + if (this->audio_wrap_offset) { + if (this->audio_wrap_offset>this->video_wrap_offset) + this->video_wrap_offset = this->audio_wrap_offset; + else + this->audio_wrap_offset = this->video_wrap_offset; + } printf ("metronom: first video pts => offset = %d\n", this->video_wrap_offset); @@ -403,6 +410,13 @@ static uint32_t metronom_got_audio_samples (metronom_t *this, uint32_t pts, uint this->audio_wrap_offset = -1 * pts; + if (this->video_wrap_offset) { + if (this->audio_wrap_offset>this->video_wrap_offset) + this->video_wrap_offset = this->audio_wrap_offset; + else + this->audio_wrap_offset = this->video_wrap_offset; + } + printf ("metronom: first audio pts => offset = %d\n", this->audio_wrap_offset); } -- cgit v1.2.3