From 7751dc4834a0861c8e4fecf5683dda4debce9e32 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Fri, 22 Mar 2002 18:20:03 +0000 Subject: fix discontinuity handling when player resume/start CVS patchset: 1616 CVS date: 2002/03/22 18:20:03 --- src/xine-engine/metronom.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c index f589a9554..8b194c5ac 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.71 2002/03/20 23:12:58 guenter Exp $ + * $Id: metronom.c,v 1.72 2002/03/22 18:20:03 miguelfreitas Exp $ */ #ifdef HAVE_CONFIG_H @@ -295,6 +295,11 @@ static void metronom_handle_video_discontinuity (metronom_t *this, int type, pthread_cond_wait (&this->audio_discontinuity_reached, &this->lock); } + if ( this->video_vpts < metronom_get_current_time(this) ) { + this->video_vpts = PREBUFFER_PTS_OFFSET + metronom_get_current_time(this); + printf ("metronom: video vpts adjusted with prebuffer to %lld\n", this->video_vpts); + } + if (this->video_vpts < this->audio_vpts) { this->video_vpts = this->audio_vpts; printf ("metronom: video vpts adjusted to %lld\n", this->video_vpts); @@ -418,11 +423,16 @@ static void metronom_handle_audio_discontinuity (metronom_t *this, int type, pthread_cond_wait (&this->video_discontinuity_reached, &this->lock); } + if ( this->audio_vpts < metronom_get_current_time(this) ) { + this->audio_vpts = PREBUFFER_PTS_OFFSET + metronom_get_current_time(this); + printf ("metronom: audio vpts adjusted with prebuffer to %lld\n", this->audio_vpts); + } + if ( this->audio_vpts < this->video_vpts ) { this->audio_vpts = this->video_vpts; printf ("metronom: audio vpts adjusted to %lld\n", this->audio_vpts); } - + /* next_vpts_offset, in_discontinuity is handled in expect_video_discontinuity */ pthread_mutex_unlock (&this->lock); -- cgit v1.2.3