diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xine-engine/metronom.c | 14 | ||||
| -rw-r--r-- | src/xine-engine/metronom.h | 3 | 
2 files changed, 12 insertions, 5 deletions
| diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c index 446387459..d189142c0 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.92 2002/09/05 22:19:04 mroi Exp $ + * $Id: metronom.c,v 1.93 2002/09/05 22:29:17 mroi Exp $   */  #ifdef HAVE_CONFIG_H @@ -329,6 +329,7 @@ static void metronom_handle_video_discontinuity (metronom_t *this, int type,  #endif      this->vpts_offset      = this->video_vpts;      this->in_discontinuity = 0; +    this->force_audio_jump = 0;      break;    case DISC_ABSOLUTE:  #ifdef LOG @@ -336,6 +337,7 @@ static void metronom_handle_video_discontinuity (metronom_t *this, int type,  #endif      this->next_vpts_offset = this->video_vpts - disc_off;      this->in_discontinuity = 30; +    this->force_audio_jump = 0;      break;    case DISC_RELATIVE:  #ifdef LOG @@ -343,13 +345,16 @@ static void metronom_handle_video_discontinuity (metronom_t *this, int type,  #endif      this->next_vpts_offset = this->vpts_offset - disc_off;      this->in_discontinuity = 30; +    this->force_audio_jump = 0;      break;    case DISC_STREAMSEEK:  #ifdef LOG      printf ("metronom: DISC_STREAMSEEK\n");  #endif      this->vpts_offset      = this->video_vpts - disc_off; -    this->in_discontinuity = 0; +    this->next_vpts_offset = this->video_vpts - disc_off; +    this->in_discontinuity = 30; +    this->force_audio_jump = 1;      this->allow_full_ao_fill_gap = 1;      break;    } @@ -497,16 +502,17 @@ static int64_t metronom_got_audio_samples (metronom_t *this, int64_t pts,    pthread_mutex_lock (&this->lock); -  if (this->in_discontinuity)  +  if (this->in_discontinuity && !this->force_audio_jump)       pts = 0; /* ignore pts during discontinuities */    if (pts) {      vpts = pts + this->vpts_offset;      diff = this->audio_vpts - vpts;      /* compare predicted and given vpts */ -    if((abs(diff) > AUDIO_DRIFT_TOLERANCE) || this->allow_full_ao_fill_gap) { +    if( (abs(diff) > AUDIO_DRIFT_TOLERANCE) || this->force_audio_jump ) {        this->audio_vpts = vpts;        this->audio_drift_step = 0; +      this->force_audio_jump = 0;        printf("metronom: audio jump\n");      }      else { diff --git a/src/xine-engine/metronom.h b/src/xine-engine/metronom.h index 64708bd84..3fb081b37 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.35 2002/09/05 22:19:04 mroi Exp $ + * $Id: metronom.h,v 1.36 2002/09/05 22:29:17 mroi Exp $   *   * metronom: general pts => virtual calculation/assoc   *                    @@ -244,6 +244,7 @@ struct metronom_s {    pthread_cond_t  cancel;    int             allow_full_ao_fill_gap; +  int             force_audio_jump;  };  metronom_t *metronom_init (int have_audio, void *xine); | 
