Program: 110325
Project: 110325
Buggy source:
private long seekToPeriodPosition(int periodIndex,long periodPositionUs) throws ExoPlaybackException {
  stopRenderers();
  rebuffering=false;
  setState(ExoPlayer.STATE_BUFFERING);
  if (periodPositionUs == C.TIME_UNSET || (readingPeriodHolder != playingPeriodHolder && (periodIndex == playingPeriodHolder.index || periodIndex == readingPeriodHolder.index))) {
    periodIndex=C.INDEX_UNSET;
  }
  MediaPeriodHolder newPlayingPeriodHolder=null;
  if (playingPeriodHolder == null) {
    if (loadingPeriodHolder != null) {
      loadingPeriodHolder.release();
    }
  }
 else {
    MediaPeriodHolder periodHolder=playingPeriodHolder;
    while (periodHolder != null) {
      if (periodHolder.index == periodIndex && periodHolder.prepared) {
        newPlayingPeriodHolder=periodHolder;
      }
 else {
        periodHolder.release();
      }
      periodHolder=periodHolder.next;
    }
  }
  if (newPlayingPeriodHolder != playingPeriodHolder) {
    for (    Renderer renderer : enabledRenderers) {
      renderer.disable();
    }
    enabledRenderers=new Renderer[0];
    rendererMediaClock=null;
    rendererMediaClockSource=null;
  }
  bufferAheadPeriodCount=0;
  if (newPlayingPeriodHolder != null) {
    newPlayingPeriodHolder.next=null;
    setPlayingPeriodHolder(newPlayingPeriodHolder);
    updateTimelineState();
    readingPeriodHolder=playingPeriodHolder;
    loadingPeriodHolder=playingPeriodHolder;
    if (playingPeriodHolder.hasEnabledTracks) {
      periodPositionUs=playingPeriodHolder.mediaPeriod.seekToUs(periodPositionUs);
    }
    resetRendererPosition(periodPositionUs);
    maybeContinueLoading();
  }
 else {
    playingPeriodHolder=null;
    readingPeriodHolder=null;
    loadingPeriodHolder=null;
    if (periodPositionUs != C.TIME_UNSET) {
      resetRendererPosition(periodPositionUs);
    }
  }
  updatePlaybackPositions();
  handler.sendEmptyMessage(MSG_DO_SOME_WORK);
  return periodPositionUs;
}

Fixed version (ground truth):
private long seekToPeriodPosition(int periodIndex,long periodPositionUs) throws ExoPlaybackException {
  stopRenderers();
  rebuffering=false;
  setState(ExoPlayer.STATE_BUFFERING);
  if (readingPeriodHolder != playingPeriodHolder && (periodIndex == playingPeriodHolder.index || periodIndex == readingPeriodHolder.index)) {
    periodIndex=C.INDEX_UNSET;
  }
  MediaPeriodHolder newPlayingPeriodHolder=null;
  if (playingPeriodHolder == null) {
    if (loadingPeriodHolder != null) {
      loadingPeriodHolder.release();
    }
  }
 else {
    MediaPeriodHolder periodHolder=playingPeriodHolder;
    while (periodHolder != null) {
      if (periodHolder.index == periodIndex && periodHolder.prepared) {
        newPlayingPeriodHolder=periodHolder;
      }
 else {
        periodHolder.release();
      }
      periodHolder=periodHolder.next;
    }
  }
  if (newPlayingPeriodHolder != playingPeriodHolder) {
    for (    Renderer renderer : enabledRenderers) {
      renderer.disable();
    }
    enabledRenderers=new Renderer[0];
    rendererMediaClock=null;
    rendererMediaClockSource=null;
  }
  bufferAheadPeriodCount=0;
  if (newPlayingPeriodHolder != null) {
    newPlayingPeriodHolder.next=null;
    setPlayingPeriodHolder(newPlayingPeriodHolder);
    updateTimelineState();
    readingPeriodHolder=playingPeriodHolder;
    loadingPeriodHolder=playingPeriodHolder;
    if (playingPeriodHolder.hasEnabledTracks) {
      periodPositionUs=playingPeriodHolder.mediaPeriod.seekToUs(periodPositionUs);
    }
    resetRendererPosition(periodPositionUs);
    maybeContinueLoading();
  }
 else {
    playingPeriodHolder=null;
    readingPeriodHolder=null;
    loadingPeriodHolder=null;
    resetRendererPosition(periodPositionUs);
  }
  updatePlaybackPositions();
  handler.sendEmptyMessage(MSG_DO_SOME_WORK);
  return periodPositionUs;
}