Program: 110365
Project: 110365
Buggy source:
/** 
 * @param manifestLoaderErrorThrower Throws errors affecting loading of manifests.
 * @param manifest The initial manifest.
 * @param periodIndex The index of the period in the manifest.
 * @param adaptationSetIndex The index of the adaptation set in the period.
 * @param trackSelection The track selection.
 * @param dataSource A {@link DataSource} suitable for loading the media data.
 * @param elapsedRealtimeOffsetMs If known, an estimate of the instantaneous difference betweenserver-side unix time and  {@link SystemClock#elapsedRealtime()} in milliseconds, specifiedas the server's unix time minus the local elapsed time. If unknown, set to 0.
 */
public DefaultDashChunkSource(LoaderErrorThrower manifestLoaderErrorThrower,DashManifest manifest,int periodIndex,int adaptationSetIndex,TrackSelection trackSelection,DataSource dataSource,long elapsedRealtimeOffsetMs){
  this.manifestLoaderErrorThrower=manifestLoaderErrorThrower;
  this.manifest=manifest;
  this.adaptationSetIndex=adaptationSetIndex;
  this.trackSelection=trackSelection;
  this.dataSource=dataSource;
  this.periodIndex=periodIndex;
  this.elapsedRealtimeOffsetUs=elapsedRealtimeOffsetMs * 1000;
  long periodDurationUs=manifest.getPeriodDurationUs(periodIndex);
  List<Representation> representations=getRepresentations();
  representationHolders=new RepresentationHolder[trackSelection.length()];
  for (int i=0; i < representationHolders.length; i++) {
    Representation representation=representations.get(trackSelection.getIndexInTrackGroup(i));
    representationHolders[i]=new RepresentationHolder(periodDurationUs,representation);
  }
}

Fixed version (ground truth):
/** 
 * @param manifestLoaderErrorThrower Throws errors affecting loading of manifests.
 * @param manifest The initial manifest.
 * @param periodIndex The index of the period in the manifest.
 * @param adaptationSetIndex The index of the adaptation set in the period.
 * @param trackSelection The track selection.
 * @param dataSource A {@link DataSource} suitable for loading the media data.
 * @param elapsedRealtimeOffsetMs If known, an estimate of the instantaneous difference betweenserver-side unix time and  {@link SystemClock#elapsedRealtime()} in milliseconds, specifiedas the server's unix time minus the local elapsed time. If unknown, set to 0.
 */
public DefaultDashChunkSource(LoaderErrorThrower manifestLoaderErrorThrower,DashManifest manifest,int periodIndex,int adaptationSetIndex,TrackSelection trackSelection,DataSource dataSource,long elapsedRealtimeOffsetMs){
  this.manifestLoaderErrorThrower=manifestLoaderErrorThrower;
  this.manifest=manifest;
  this.adaptationSetIndex=adaptationSetIndex;
  this.trackSelection=trackSelection;
  this.dataSource=dataSource;
  this.periodIndex=periodIndex;
  this.elapsedRealtimeOffsetMs=elapsedRealtimeOffsetMs;
  long periodDurationUs=manifest.getPeriodDurationUs(periodIndex);
  List<Representation> representations=getRepresentations();
  representationHolders=new RepresentationHolder[trackSelection.length()];
  for (int i=0; i < representationHolders.length; i++) {
    Representation representation=representations.get(trackSelection.getIndexInTrackGroup(i));
    representationHolders[i]=new RepresentationHolder(periodDurationUs,representation);
  }
}