summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2001-12-19 13:40:05 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2001-12-19 13:40:05 +0000
commit3da75d744f304269d5dd105e541d2149b2cbadb8 (patch)
tree0a580c2ae3f300553b69ddbf205ffe0a9a7b39ee
parent56374300649cd0e14fb0f167661734bb30439f00 (diff)
downloadxine-lib-3da75d744f304269d5dd105e541d2149b2cbadb8.tar.gz
xine-lib-3da75d744f304269d5dd105e541d2149b2cbadb8.tar.bz2
metronom fix: we must never update wrap_offset inside discontinuity
window CVS patchset: 1276 CVS date: 2001/12/19 13:40:05
-rw-r--r--src/xine-engine/metronom.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c
index 13f40dff1..4cbc3e89a 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.41 2001/12/16 21:52:04 miguelfreitas Exp $
+ * $Id: metronom.c,v 1.42 2001/12/19 13:40:05 miguelfreitas Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -496,6 +496,7 @@ static uint32_t metronom_got_video_frame (metronom_t *this, uint32_t pts, uint32
this->video_stream_starting ) {
this->video_discontinuity = 0;
this->video_stream_starting = 0;
+ this->wrap_diff_counter = 0;
this->video_wrap_offset += this->last_video_pts - pts
+ (this->num_video_vpts_guessed+1) * this->avg_frame_duration;
@@ -510,7 +511,8 @@ static uint32_t metronom_got_video_frame (metronom_t *this, uint32_t pts, uint32
* audio and video wrap are not allowed to differ for too long
*/
if ( !this->audio_stream_starting && this->have_audio
- && (this->video_wrap_offset != this->audio_wrap_offset)) {
+ && (this->video_wrap_offset != this->audio_wrap_offset)
+ && !this->video_discontinuity && !this->audio_discontinuity ) {
this->wrap_diff_counter++;
if (this->wrap_diff_counter > MAX_NUM_WRAP_DIFF) {
@@ -676,6 +678,7 @@ static uint32_t metronom_got_audio_samples (metronom_t *this, uint32_t pts,
if ( this->audio_discontinuity || this->audio_stream_starting ) {
this->audio_discontinuity = 0;
this->audio_stream_starting = 0;
+ this->wrap_diff_counter = 0;
this->audio_wrap_offset += this->last_audio_pts - pts
+ this->num_audio_samples_guessed
@@ -691,7 +694,8 @@ static uint32_t metronom_got_audio_samples (metronom_t *this, uint32_t pts,
* for too long
*/
- if ( this->video_wrap_offset != this->audio_wrap_offset ) {
+ if ( this->video_wrap_offset != this->audio_wrap_offset
+ && !this->video_discontinuity && !this->audio_discontinuity ) {
this->wrap_diff_counter++;
if (this->wrap_diff_counter > MAX_NUM_WRAP_DIFF) {