nus-yam/ex-repair huggingface dataset:
Program: 110370
Project: 110370
Buggy source:
private void updateFormatEvaluation(HlsMediaChunk previous,long playbackPositionUs){
  clearStaleBlacklistedVariants();
  if (!seenFirstExternalTrackSelection && !enabledVariantBlacklistFlags[initialEnabledVariantIndex]) {
    evaluation.format=variants[0].format;
  }
 else   if (enabledVariants.length > 1) {
    long bufferedDurationUs;
    if (previous != null) {
      bufferedDurationUs=Math.max(0,previous.startTimeUs - playbackPositionUs);
    }
 else {
      bufferedDurationUs=0;
    }
    adaptiveFormatEvaluator.evaluateFormat(bufferedDurationUs,enabledVariantBlacklistFlags,evaluation);
  }
 else {
    evaluation.format=enabledVariants[0].format;
  }
}

Fixed version (ground truth):
private void updateFormatEvaluation(HlsMediaChunk previous,long playbackPositionUs){
  clearStaleBlacklistedVariants();
  if (!seenFirstExternalTrackSelection) {
    if (!enabledVariantBlacklistFlags[getEnabledVariantIndex(variants[0].format)]) {
      evaluation.format=variants[0].format;
      return;
    }
    for (int i=enabledVariants.length - 1; i >= 0; i--) {
      if (!enabledVariantBlacklistFlags[i]) {
        evaluation.format=enabledVariants[i].format;
        return;
      }
    }
    throw new IllegalStateException();
  }
  if (enabledVariants.length == 1) {
    evaluation.format=enabledVariants[0].format;
    return;
  }
  long bufferedDurationUs;
  if (previous != null) {
    bufferedDurationUs=Math.max(0,previous.startTimeUs - playbackPositionUs);
  }
 else {
    bufferedDurationUs=0;
  }
  adaptiveFormatEvaluator.evaluateFormat(bufferedDurationUs,enabledVariantBlacklistFlags,evaluation);
}
Program: 110371
Project: 110371
Buggy source:
private void selectTracksInternal(int[] tracks,boolean isExternal){
  seenFirstExternalTrackSelection|=isExternal;
  enabledVariants=new Variant[tracks.length];
  for (int i=0; i < tracks.length; i++) {
    enabledVariants[i]=variants[tracks[i]];
  }
  Arrays.sort(enabledVariants,new Comparator<Variant>(){
    private final Comparator<Format> formatComparator=new Format.DecreasingBandwidthComparator();
    @Override public int compare(    Variant first,    Variant second){
      return formatComparator.compare(first.format,second.format);
    }
  }
);
  enabledVariantBlacklistTimes=new long[enabledVariants.length];
  enabledVariantBlacklistFlags=new boolean[enabledVariants.length];
  if (enabledVariants.length > 1) {
    Format[] formats=new Format[enabledVariants.length];
    for (int i=0; i < formats.length; i++) {
      formats[i]=enabledVariants[i].format;
    }
    adaptiveFormatEvaluator.enable(formats);
    if (!Util.contains(formats,evaluation.format)) {
      evaluation.format=null;
    }
  }
 else {
    evaluation.trigger=FormatEvaluator.TRIGGER_UNKNOWN;
    evaluation.data=null;
  }
}

Fixed version (ground truth):
private void selectTracksInternal(int[] tracks,boolean isExternal){
  seenFirstExternalTrackSelection|=isExternal;
  enabledVariants=new Variant[tracks.length];
  for (int i=0; i < tracks.length; i++) {
    enabledVariants[i]=variants[tracks[i]];
  }
  Arrays.sort(enabledVariants,new Comparator<Variant>(){
    private final Comparator<Format> formatComparator=new Format.DecreasingBandwidthComparator();
    @Override public int compare(    Variant first,    Variant second){
      return formatComparator.compare(first.format,second.format);
    }
  }
);
  enabledVariantBlacklistTimes=new long[enabledVariants.length];
  enabledVariantBlacklistFlags=new boolean[enabledVariants.length];
  if (!isExternal) {
    return;
  }
  if (enabledVariants.length > 1) {
    Format[] formats=new Format[enabledVariants.length];
    for (int i=0; i < formats.length; i++) {
      formats[i]=enabledVariants[i].format;
    }
    adaptiveFormatEvaluator.enable(formats);
    if (!Util.contains(formats,evaluation.format)) {
      evaluation.format=null;
    }
  }
 else {
    evaluation.trigger=FormatEvaluator.TRIGGER_UNKNOWN;
    evaluation.data=null;
  }
}
Program: 110372
Project: 110372
Buggy source:
@Override public void onContinueLoadingRequested(HlsTrackStreamWrapper trackStreamWrapper){
  callback.onContinueLoadingRequested(this);
}

Fixed version (ground truth):
@Override public void onContinueLoadingRequested(HlsTrackStreamWrapper trackStreamWrapper){
  if (trackGroups == null) {
    return;
  }
  callback.onContinueLoadingRequested(this);
}
Program: 110374
Project: 110374
Buggy source:
public List<Cue> getCues(long timeUs,Map<String,TtmlStyle> globalStyles,Map<String,TtmlRegion> regionMap){
  TreeMap<String,SpannableStringBuilder> regionOutputs=new TreeMap<>();
  traverseForText(timeUs,false,regionId,regionOutputs);
  traverseForStyle(globalStyles,regionOutputs);
  List<Cue> cues=new ArrayList<>();
  for (  Entry<String,SpannableStringBuilder> entry : regionOutputs.entrySet()) {
    TtmlRegion region=regionMap.get(entry.getKey());
    cues.add(new Cue(cleanUpText(entry.getValue()),null,region.line,Cue.TYPE_UNSET,Cue.TYPE_UNSET,region.position,Cue.TYPE_UNSET,region.width));
  }
  return cues;
}

Fixed version (ground truth):
public List<Cue> getCues(long timeUs,Map<String,TtmlStyle> globalStyles,Map<String,TtmlRegion> regionMap){
  TreeMap<String,SpannableStringBuilder> regionOutputs=new TreeMap<>();
  traverseForText(timeUs,false,regionId,regionOutputs);
  traverseForStyle(globalStyles,regionOutputs);
  List<Cue> cues=new ArrayList<>();
  for (  Entry<String,SpannableStringBuilder> entry : regionOutputs.entrySet()) {
    TtmlRegion region=regionMap.get(entry.getKey());
    cues.add(new Cue(cleanUpText(entry.getValue()),null,region.line,region.lineType,Cue.TYPE_UNSET,region.position,Cue.TYPE_UNSET,region.width));
  }
  return cues;
}
Program: 110376
Project: 110376
Buggy source:
public TtmlRegion(float position,float line,float width){
  this.position=position;
  this.line=line;
  this.width=width;
}

Fixed version (ground truth):
public TtmlRegion(float position,float line,int lineType,float width){
  this.position=position;
  this.line=line;
  this.lineType=lineType;
  this.width=width;
}
Program: 110378
Project: 110378
Buggy source:
@Override public long readDiscontinuity(){
  for (  SampleSource source : enabledSources) {
    if (source.readDiscontinuity() != C.UNSET_TIME_US) {
      throw new IllegalStateException("String_Node_Str");
    }
  }
  return C.UNSET_TIME_US;
}

Fixed version (ground truth):
@Override public long readDiscontinuity(){
  long positionUs=enabledSources[0].readDiscontinuity();
  if (positionUs != C.UNSET_TIME_US) {
    for (int i=1; i < enabledSources.length; i++) {
      if (enabledSources[i].seekToUs(positionUs) != positionUs) {
        throw new IllegalStateException("String_Node_Str");
      }
    }
  }
  for (int i=1; i < enabledSources.length; i++) {
    if (enabledSources[i].readDiscontinuity() != C.UNSET_TIME_US) {
      throw new IllegalStateException("String_Node_Str");
    }
  }
  return positionUs;
}
Program: 110380
Project: 110380
Buggy source:
@Override public long seekToUs(long positionUs){
  positionUs=seekMap.isSeekable() ? positionUs : 0;
  lastSeekPositionUs=positionUs;
  notifyReset=true;
  boolean seekInsideBuffer=!isPendingReset();
  for (int i=0; seekInsideBuffer && i < sampleQueues.length; i++) {
    if (trackEnabledStates[i]) {
      seekInsideBuffer=sampleQueues[i].skipToKeyframeBefore(positionUs);
    }
  }
  if (!seekInsideBuffer) {
    restartFrom(positionUs);
  }
  return positionUs;
}

Fixed version (ground truth):
@Override public long seekToUs(long positionUs){
  positionUs=seekMap.isSeekable() ? positionUs : 0;
  lastSeekPositionUs=positionUs;
  boolean seekInsideBuffer=!isPendingReset();
  for (int i=0; seekInsideBuffer && i < sampleQueues.length; i++) {
    if (trackEnabledStates[i]) {
      seekInsideBuffer=sampleQueues[i].skipToKeyframeBefore(positionUs);
    }
  }
  if (!seekInsideBuffer) {
    restartFrom(positionUs);
  }
  notifyReset=false;
  return positionUs;
}
Program: 110381
Project: 110381
Buggy source:
private void startLoading(){
  ExtractingLoadable loadable=new ExtractingLoadable(uri,dataSource,extractorHolder,loadCondition);
  if (prepared) {
    Assertions.checkState(isPendingReset());
    if (durationUs != C.UNSET_TIME_US && pendingResetPositionUs >= durationUs) {
      loadingFinished=true;
      pendingResetPositionUs=C.UNSET_TIME_US;
      return;
    }
    loadable.setLoadPosition(seekMap.getPosition(pendingResetPositionUs));
    pendingResetPositionUs=C.UNSET_TIME_US;
  }
  extractedSamplesCountAtStartOfLoad=getExtractedSamplesCount();
  int minRetryCount=minLoadableRetryCount;
  if (minRetryCount == MIN_RETRY_COUNT_DEFAULT_FOR_MEDIA) {
    minRetryCount=!prepared || (length != C.LENGTH_UNBOUNDED || (seekMap != null && seekMap.getDurationUs() != C.UNSET_TIME_US)) ? DEFAULT_MIN_LOADABLE_RETRY_COUNT_ON_DEMAND : DEFAULT_MIN_LOADABLE_RETRY_COUNT_LIVE;
  }
  loader.startLoading(loadable,this,minRetryCount);
}

Fixed version (ground truth):
private void startLoading(){
  ExtractingLoadable loadable=new ExtractingLoadable(uri,dataSource,extractorHolder,loadCondition);
  if (prepared) {
    Assertions.checkState(isPendingReset());
    if (durationUs != C.UNSET_TIME_US && pendingResetPositionUs >= durationUs) {
      loadingFinished=true;
      pendingResetPositionUs=C.UNSET_TIME_US;
      return;
    }
    loadable.setLoadPosition(seekMap.getPosition(pendingResetPositionUs));
    pendingResetPositionUs=C.UNSET_TIME_US;
  }
  extractedSamplesCountAtStartOfLoad=getExtractedSamplesCount();
  loader.startLoading(loadable,this,0);
}
Program: 110382
Project: 110382
Buggy source:
public LoadTask(Looper looper,T loadable,Loader.Callback<T> callback,int minRetryCount,long startTimeMs){
  super(looper);
  this.loadable=loadable;
  this.callback=callback;
  this.minRetryCount=minRetryCount;
  this.startTimeMs=startTimeMs;
}

Fixed version (ground truth):
public LoadTask(Looper looper,T loadable,Loader.Callback<T> callback,int defaultMinRetryCount,long startTimeMs){
  super(looper);
  this.loadable=loadable;
  this.callback=callback;
  this.defaultMinRetryCount=defaultMinRetryCount;
  this.startTimeMs=startTimeMs;
}
Program: 110383
Project: 110383
Buggy source:
/** 
 * Start loading a   {@link Loadable}. <p> The calling thread must be a   {@link Looper} thread, which is the thread on which the{@link Callback} will be invoked.
 * @param loadable The {@link Loadable} to load.
 * @param callback A callback to invoke when the load ends.
 * @param minRetryCount The minimum number of times the load must be retried before{@link #maybeThrowError()} will propagate an error.
 * @throws IllegalStateException If the calling thread does not have an associated {@link Looper}.
 * @return {@link SystemClock#elapsedRealtime} when the load started.
 */
public <T extends Loadable>long startLoading(T loadable,Callback<T> callback,int minRetryCount){
  Looper looper=Looper.myLooper();
  Assertions.checkState(looper != null);
  long startTimeMs=SystemClock.elapsedRealtime();
  new LoadTask<>(looper,loadable,callback,minRetryCount,startTimeMs).start(0);
  return startTimeMs;
}

Fixed version (ground truth):
/** 
 * Start loading a   {@link Loadable}. <p> The calling thread must be a   {@link Looper} thread, which is the thread on which the{@link Callback} will be invoked.
 * @param loadable The {@link Loadable} to load.
 * @param callback A callback to invoke when the load ends.
 * @param defaultMinRetryCount The minimum number of times the load must be retried before{@link #maybeThrowError()} will propagate an error.
 * @throws IllegalStateException If the calling thread does not have an associated {@link Looper}.
 * @return {@link SystemClock#elapsedRealtime} when the load started.
 */
public <T extends Loadable>long startLoading(T loadable,Callback<T> callback,int defaultMinRetryCount){
  Looper looper=Looper.myLooper();
  Assertions.checkState(looper != null);
  long startTimeMs=SystemClock.elapsedRealtime();
  new LoadTask<>(looper,loadable,callback,defaultMinRetryCount,startTimeMs).start(0);
  return startTimeMs;
}
Program: 110384
Project: 110384
Buggy source:
public void maybeThrowError() throws IOException {
  if (currentError != null && errorCount > minRetryCount) {
    throw currentError;
  }
}

Fixed version (ground truth):
public void maybeThrowError(int minRetryCount) throws IOException {
  if (currentError != null && errorCount > minRetryCount) {
    throw currentError;
  }
}
Program: 110386
Project: 110386
Buggy source:
@Override public boolean isReady(){
  return loadingFinished || !sampleQueue.isEmpty();
}

Fixed version (ground truth):
@Override public boolean isReady(){
  return loadingFinished || (!isPendingReset() && !sampleQueue.isEmpty());
}
Program: 110387
Project: 110387
Buggy source:
@Override public TrackStream[] selectTracks(List<TrackStream> oldStreams,List<TrackSelection> newSelections,long positionUs){
  Assertions.checkState(prepared);
  Assertions.checkState(oldStreams.size() <= 1);
  Assertions.checkState(newSelections.size() <= 1);
  boolean trackWasEnabled=trackEnabled;
  if (!oldStreams.isEmpty()) {
    Assertions.checkState(trackEnabled);
    trackEnabled=false;
    chunkSource.disable();
  }
  TrackStream[] newStreams=new TrackStream[newSelections.size()];
  if (!newSelections.isEmpty()) {
    Assertions.checkState(!trackEnabled);
    trackEnabled=true;
    chunkSource.enable(newSelections.get(0).getTracks());
    newStreams[0]=this;
  }
  if (!trackEnabled) {
    if (trackWasEnabled) {
      loadControl.unregister(this);
    }
    if (loader.isLoading()) {
      loader.cancelLoading();
    }
 else {
      clearState();
      loadControl.trimAllocator();
    }
  }
 else {
    if (!trackWasEnabled) {
      loadControl.register(this,bufferSizeContribution);
    }
    downstreamFormat=null;
    downstreamSampleFormat=null;
    downstreamPositionUs=positionUs;
    lastSeekPositionUs=positionUs;
    pendingReset=false;
    restartFrom(positionUs);
  }
  return newStreams;
}

Fixed version (ground truth):
@Override public TrackStream[] selectTracks(List<TrackStream> oldStreams,List<TrackSelection> newSelections,long positionUs){
  Assertions.checkState(prepared);
  Assertions.checkState(oldStreams.size() <= 1);
  Assertions.checkState(newSelections.size() <= 1);
  boolean trackWasEnabled=trackEnabled;
  if (!oldStreams.isEmpty()) {
    Assertions.checkState(trackEnabled);
    trackEnabled=false;
    chunkSource.disable();
  }
  TrackStream[] newStreams=new TrackStream[newSelections.size()];
  if (!newSelections.isEmpty()) {
    Assertions.checkState(!trackEnabled);
    trackEnabled=true;
    chunkSource.enable(newSelections.get(0).getTracks());
    newStreams[0]=this;
  }
  if (!trackEnabled) {
    if (trackWasEnabled) {
      loadControl.unregister(this);
    }
    if (loader.isLoading()) {
      loader.cancelLoading();
    }
 else {
      clearState();
      loadControl.trimAllocator();
    }
  }
 else {
    if (!trackWasEnabled) {
      loadControl.register(this,bufferSizeContribution);
    }
    downstreamFormat=null;
    sampleQueue.needDownstreamFormat();
    downstreamPositionUs=positionUs;
    lastSeekPositionUs=positionUs;
    pendingReset=false;
    restartFrom(positionUs);
  }
  return newStreams;
}
Program: 110388
Project: 110388
Buggy source:
@Override public int readData(FormatHolder formatHolder,DecoderInputBuffer buffer){
  if (pendingReset || isPendingReset()) {
    return NOTHING_READ;
  }
  BaseMediaChunk currentChunk=mediaChunks.getFirst();
  while (mediaChunks.size() > 1 && mediaChunks.get(1).getFirstSampleIndex() <= sampleQueue.getReadIndex()) {
    mediaChunks.removeFirst();
    currentChunk=mediaChunks.getFirst();
  }
  if (downstreamFormat == null || !downstreamFormat.equals(currentChunk.format)) {
    eventDispatcher.downstreamFormatChanged(currentChunk.format,currentChunk.trigger,currentChunk.startTimeUs);
    downstreamFormat=currentChunk.format;
  }
  if (sampleQueue.isEmpty()) {
    if (loadingFinished) {
      buffer.addFlag(C.BUFFER_FLAG_END_OF_STREAM);
      return BUFFER_READ;
    }
    return NOTHING_READ;
  }
  Format sampleFormat=sampleQueue.getDownstreamFormat();
  if (!sampleFormat.equals(downstreamSampleFormat)) {
    formatHolder.format=sampleFormat;
    formatHolder.drmInitData=currentChunk.getDrmInitData();
    downstreamSampleFormat=sampleFormat;
    return FORMAT_READ;
  }
  if (sampleQueue.readSample(buffer)) {
    if (buffer.timeUs < lastSeekPositionUs) {
      buffer.addFlag(C.BUFFER_FLAG_DECODE_ONLY);
    }
    onSampleRead(currentChunk,buffer);
    return BUFFER_READ;
  }
  return NOTHING_READ;
}

Fixed version (ground truth):
@Override public int readData(FormatHolder formatHolder,DecoderInputBuffer buffer){
  if (pendingReset || isPendingReset()) {
    return NOTHING_READ;
  }
  while (mediaChunks.size() > 1 && mediaChunks.get(1).getFirstSampleIndex() <= sampleQueue.getReadIndex()) {
    mediaChunks.removeFirst();
  }
  BaseMediaChunk currentChunk=mediaChunks.getFirst();
  Format currentFormat=currentChunk.format;
  if (downstreamFormat == null || !downstreamFormat.equals(currentFormat)) {
    eventDispatcher.downstreamFormatChanged(currentFormat,currentChunk.trigger,currentChunk.startTimeUs);
    downstreamFormat=currentFormat;
  }
  int result=sampleQueue.readData(formatHolder,buffer,loadingFinished);
switch (result) {
case FORMAT_READ:
    formatHolder.drmInitData=currentChunk.getDrmInitData();
  break;
case BUFFER_READ:
if (!buffer.isEndOfStream()) {
  if (buffer.timeUs < lastSeekPositionUs) {
    buffer.addFlag(C.BUFFER_FLAG_DECODE_ONLY);
  }
  onSampleRead(currentChunk,buffer);
}
break;
}
return result;
}
Program: 110389
Project: 110389
Buggy source:
@Override public void sampleMetadata(long timeUs,int flags,int size,int offset,byte[] encryptionKey){
  if (pendingSplice) {
    if ((flags & C.BUFFER_FLAG_KEY_FRAME) == 0 || !infoQueue.attemptSplice(timeUs)) {
      return;
    }
    pendingSplice=false;
  }
  if (needKeyframe) {
    if ((flags & C.BUFFER_FLAG_KEY_FRAME) == 0) {
      return;
    }
    needKeyframe=false;
  }
  timeUs+=sampleOffsetUs;
  long absoluteOffset=totalBytesWritten - size - offset;
  infoQueue.commitSample(timeUs,flags,absoluteOffset,size,encryptionKey,upstreamFormat);
}

Fixed version (ground truth):
@Override public void sampleMetadata(long timeUs,int flags,int size,int offset,byte[] encryptionKey){
  if (pendingSplice) {
    if ((flags & C.BUFFER_FLAG_KEY_FRAME) == 0 || !infoQueue.attemptSplice(timeUs)) {
      return;
    }
    pendingSplice=false;
  }
  if (needKeyframe) {
    if ((flags & C.BUFFER_FLAG_KEY_FRAME) == 0) {
      return;
    }
    needKeyframe=false;
  }
  timeUs+=sampleOffsetUs;
  long absoluteOffset=totalBytesWritten - size - offset;
  infoQueue.commitSample(timeUs,flags,absoluteOffset,size,encryptionKey);
}
Program: 110391
Project: 110391
Buggy source:
/** 
 * Returns the current upstream   {@link Format}.
 */
public Format getUpstreamFormat(){
  return upstreamFormat;
}

Fixed version (ground truth):
/** 
 * Returns the upstream   {@link Format} in which samples are being queued.
 */
public synchronized Format getUpstreamFormat(){
  return upstreamFormat;
}
Program: 110392
Project: 110392
Buggy source:
/** 
 * Reads data from the front of the rolling buffer.
 * @param absolutePosition The absolute position from which data should be read.
 * @param target The array into which data should be written.
 * @param length The number of bytes to read.
 */
private void readData(long absolutePosition,byte[] target,int length){
  int bytesRead=0;
  while (bytesRead < length) {
    dropDownstreamTo(absolutePosition);
    int positionInAllocation=(int)(absolutePosition - totalBytesDropped);
    int toCopy=Math.min(length - bytesRead,allocationLength - positionInAllocation);
    Allocation allocation=dataQueue.peek();
    System.arraycopy(allocation.data,allocation.translateOffset(positionInAllocation),target,bytesRead,toCopy);
    absolutePosition+=toCopy;
    bytesRead+=toCopy;
  }
}

Fixed version (ground truth):
/** 
 * Attempts to read from the queue.
 * @param formatHolder A {@link FormatHolder} to populate in the case of reading a format.
 * @param buffer A {@link DecoderInputBuffer} to populate in the case of reading a sample or theend of the stream. If a sample is read then the buffer is populated with information about the sample, but not its data. The absolute position of the data in the rolling buffer is stored in  {@code extrasHolder}, along with an encryption id if present and the absolute position of the first byte that may still be required after the current sample has been read.
 * @param extrasHolder The holder into which extra sample information should be written.
 * @return The result, which can be {@link TrackStream#NOTHING_READ},  {@link TrackStream#FORMAT_READ} or {@link TrackStream#BUFFER_READ}.
 */
public synchronized int readData(FormatHolder formatHolder,DecoderInputBuffer buffer,Format downstreamFormat,BufferExtrasHolder extrasHolder){
  if (queueSize == 0) {
    if (upstreamFormat != null && !upstreamFormat.equals(downstreamFormat)) {
      formatHolder.format=upstreamFormat;
      return TrackStream.FORMAT_READ;
    }
    return TrackStream.NOTHING_READ;
  }
  if (!formats[relativeReadIndex].equals(downstreamFormat)) {
    formatHolder.format=formats[relativeReadIndex];
    return TrackStream.FORMAT_READ;
  }
  buffer.timeUs=timesUs[relativeReadIndex];
  buffer.size=sizes[relativeReadIndex];
  buffer.setFlags(flags[relativeReadIndex]);
  extrasHolder.offset=offsets[relativeReadIndex];
  extrasHolder.encryptionKeyId=encryptionKeys[relativeReadIndex];
  largestDequeuedTimestampUs=Math.max(largestDequeuedTimestampUs,buffer.timeUs);
  queueSize--;
  relativeReadIndex++;
  absoluteReadIndex++;
  if (relativeReadIndex == capacity) {
    relativeReadIndex=0;
  }
  extrasHolder.nextOffset=queueSize > 0 ? offsets[relativeReadIndex] : extrasHolder.offset + buffer.size;
  return TrackStream.BUFFER_READ;
}
Program: 110393
Project: 110393
Buggy source:
public synchronized boolean isEmpty(){
  return queueSize == 0;
}

Fixed version (ground truth):
/** 
 * Returns whether the queue is empty.
 */
public synchronized boolean isEmpty(){
  return queueSize == 0;
}
Program: 110394
Project: 110394
Buggy source:
@Override public void format(Format format){
  upstreamFormat=getAdjustedSampleFormat(format,sampleOffsetUs);
}

Fixed version (ground truth):
public synchronized void format(Format format){
  upstreamFormat=format;
}
Program: 110396
Project: 110396
Buggy source:
public SmoothStreamingSourceBuilder(DataSourceFactory dataSourceFactory,String url,MediaDrmCallback drmCallback){
  this.dataSourceFactory=dataSourceFactory;
  this.url=url;
  this.drmCallback=drmCallback;
}

Fixed version (ground truth):
public SmoothStreamingSourceBuilder(DataSourceFactory dataSourceFactory,String url,MediaDrmCallback drmCallback){
  this.dataSourceFactory=dataSourceFactory;
  this.url=Util.toLowerInvariant(url).endsWith("String_Node_Str") ? url : url + "String_Node_Str";
  this.drmCallback=drmCallback;
}
Program: 110397
Project: 110397
Buggy source:
private void initForManifest(SmoothStreamingManifest manifest){
  for (int i=0; i < manifest.streamElements.length; i++) {
    if (manifest.streamElements[i].type == streamElementType) {
      Format[] formats=manifest.streamElements[i].formats;
      if (formats.length > 0) {
        long timescale=manifest.streamElements[i].timescale;
        extractorWrappers=new ChunkExtractorWrapper[formats.length];
        for (int j=0; j < formats.length; j++) {
          int nalUnitLengthFieldLength=streamElementType == StreamElement.TYPE_VIDEO ? 4 : -1;
          Track track=new Track(j,streamElementType,timescale,C.UNKNOWN_TIME_US,durationUs,formats[j],trackEncryptionBoxes,nalUnitLengthFieldLength,null,null);
          FragmentedMp4Extractor extractor=new FragmentedMp4Extractor(FragmentedMp4Extractor.FLAG_WORKAROUND_EVERY_VIDEO_FRAME_IS_SYNC_FRAME | FragmentedMp4Extractor.FLAG_WORKAROUND_IGNORE_TFDT_BOX,track);
          extractorWrappers[j]=new ChunkExtractorWrapper(extractor);
        }
        elementIndex=i;
        trackGroup=new TrackGroup(adaptiveFormatEvaluator != null,formats);
        return;
      }
    }
  }
  extractorWrappers=null;
  trackGroup=null;
}

Fixed version (ground truth):
private void initForManifest(SmoothStreamingManifest manifest){
  for (int i=0; i < manifest.streamElements.length; i++) {
    if (manifest.streamElements[i].type == streamElementType) {
      Format[] formats=manifest.streamElements[i].formats;
      if (formats.length > 0) {
        long timescale=manifest.streamElements[i].timescale;
        extractorWrappers=new ChunkExtractorWrapper[formats.length];
        for (int j=0; j < formats.length; j++) {
          int nalUnitLengthFieldLength=streamElementType == StreamElement.TYPE_VIDEO ? 4 : -1;
          int mp4TrackType=getMp4TrackType(streamElementType);
          Track track=new Track(j,mp4TrackType,timescale,C.UNKNOWN_TIME_US,durationUs,formats[j],trackEncryptionBoxes,nalUnitLengthFieldLength,null,null);
          FragmentedMp4Extractor extractor=new FragmentedMp4Extractor(FragmentedMp4Extractor.FLAG_WORKAROUND_EVERY_VIDEO_FRAME_IS_SYNC_FRAME | FragmentedMp4Extractor.FLAG_WORKAROUND_IGNORE_TFDT_BOX,track);
          extractorWrappers[j]=new ChunkExtractorWrapper(extractor);
        }
        elementIndex=i;
        trackGroup=new TrackGroup(adaptiveFormatEvaluator != null,formats);
        return;
      }
    }
  }
  extractorWrappers=null;
  trackGroup=null;
}
Program: 110401
Project: 110401
Buggy source:
private void readAtomPayload(ExtractorInput input) throws IOException, InterruptedException {
  int atomPayloadSize=(int)atomSize - atomHeaderBytesRead;
  if (atomData != null) {
    input.readFully(atomData.data,Atom.HEADER_SIZE,atomPayloadSize);
    onLeafAtomRead(new LeafAtom(atomType,atomData),input.getPosition());
  }
 else {
    input.skipFully(atomPayloadSize);
  }
  long currentPosition=input.getPosition();
  while (!containerAtoms.isEmpty() && containerAtoms.peek().endPosition == currentPosition) {
    onContainerAtomRead(containerAtoms.pop());
  }
  enterReadingAtomHeaderState();
}

Fixed version (ground truth):
private void readAtomPayload(ExtractorInput input) throws IOException, InterruptedException {
  int atomPayloadSize=(int)atomSize - atomHeaderBytesRead;
  if (atomData != null) {
    input.readFully(atomData.data,Atom.HEADER_SIZE,atomPayloadSize);
    onLeafAtomRead(new LeafAtom(atomType,atomData),input.getPosition());
  }
 else {
    input.skipFully(atomPayloadSize);
  }
  processAtomEnded(input.getPosition());
}
Program: 110402
Project: 110402
Buggy source:
private boolean readAtomHeader(ExtractorInput input) throws IOException, InterruptedException {
  if (atomHeaderBytesRead == 0) {
    if (!input.readFully(atomHeader.data,0,Atom.HEADER_SIZE,true)) {
      return false;
    }
    atomHeaderBytesRead=Atom.HEADER_SIZE;
    atomHeader.setPosition(0);
    atomSize=atomHeader.readUnsignedInt();
    atomType=atomHeader.readInt();
  }
  if (atomSize == Atom.LONG_SIZE_PREFIX) {
    int headerBytesRemaining=Atom.LONG_HEADER_SIZE - Atom.HEADER_SIZE;
    input.readFully(atomHeader.data,Atom.HEADER_SIZE,headerBytesRemaining);
    atomHeaderBytesRead+=headerBytesRemaining;
    atomSize=atomHeader.readUnsignedLongToLong();
  }
  if (shouldParseContainerAtom(atomType)) {
    long endPosition=input.getPosition() + atomSize - atomHeaderBytesRead;
    containerAtoms.add(new ContainerAtom(atomType,endPosition));
    enterReadingAtomHeaderState();
  }
 else   if (shouldParseLeafAtom(atomType)) {
    Assertions.checkState(atomHeaderBytesRead == Atom.HEADER_SIZE);
    Assertions.checkState(atomSize <= Integer.MAX_VALUE);
    atomData=new ParsableByteArray((int)atomSize);
    System.arraycopy(atomHeader.data,0,atomData.data,0,Atom.HEADER_SIZE);
    parserState=STATE_READING_ATOM_PAYLOAD;
  }
 else {
    atomData=null;
    parserState=STATE_READING_ATOM_PAYLOAD;
  }
  return true;
}

Fixed version (ground truth):
private boolean readAtomHeader(ExtractorInput input) throws IOException, InterruptedException {
  if (atomHeaderBytesRead == 0) {
    if (!input.readFully(atomHeader.data,0,Atom.HEADER_SIZE,true)) {
      return false;
    }
    atomHeaderBytesRead=Atom.HEADER_SIZE;
    atomHeader.setPosition(0);
    atomSize=atomHeader.readUnsignedInt();
    atomType=atomHeader.readInt();
  }
  if (atomSize == Atom.LONG_SIZE_PREFIX) {
    int headerBytesRemaining=Atom.LONG_HEADER_SIZE - Atom.HEADER_SIZE;
    input.readFully(atomHeader.data,Atom.HEADER_SIZE,headerBytesRemaining);
    atomHeaderBytesRead+=headerBytesRemaining;
    atomSize=atomHeader.readUnsignedLongToLong();
  }
  if (shouldParseContainerAtom(atomType)) {
    long endPosition=input.getPosition() + atomSize - atomHeaderBytesRead;
    containerAtoms.add(new ContainerAtom(atomType,endPosition));
    if (atomSize == atomHeaderBytesRead) {
      processAtomEnded(endPosition);
    }
 else {
      enterReadingAtomHeaderState();
    }
  }
 else   if (shouldParseLeafAtom(atomType)) {
    Assertions.checkState(atomHeaderBytesRead == Atom.HEADER_SIZE);
    Assertions.checkState(atomSize <= Integer.MAX_VALUE);
    atomData=new ParsableByteArray((int)atomSize);
    System.arraycopy(atomHeader.data,0,atomData.data,0,Atom.HEADER_SIZE);
    parserState=STATE_READING_ATOM_PAYLOAD;
  }
 else {
    atomData=null;
    parserState=STATE_READING_ATOM_PAYLOAD;
  }
  return true;
}
Program: 110403
Project: 110403
Buggy source:
/** 
 * Processes the atom payload. If   {@link #atomData} is null and the size is at or above thethreshold  {@link #RELOAD_MINIMUM_SEEK_DISTANCE},   {@code true} is returned and the caller shouldrestart loading at the position in  {@code positionHolder}. Otherwise, the atom is read/skipped.
 */
private boolean readAtomPayload(ExtractorInput input,PositionHolder positionHolder) throws IOException, InterruptedException {
  long atomPayloadSize=atomSize - atomHeaderBytesRead;
  long atomEndPosition=input.getPosition() + atomPayloadSize;
  boolean seekRequired=false;
  if (atomData != null) {
    input.readFully(atomData.data,atomHeaderBytesRead,(int)atomPayloadSize);
    if (atomType == Atom.TYPE_ftyp) {
      isQuickTime=processFtypAtom(atomData);
    }
 else     if (!containerAtoms.isEmpty()) {
      containerAtoms.peek().add(new Atom.LeafAtom(atomType,atomData));
    }
  }
 else {
    if (atomPayloadSize < RELOAD_MINIMUM_SEEK_DISTANCE) {
      input.skipFully((int)atomPayloadSize);
    }
 else {
      positionHolder.position=input.getPosition() + atomPayloadSize;
      seekRequired=true;
    }
  }
  while (!containerAtoms.isEmpty() && containerAtoms.peek().endPosition == atomEndPosition) {
    Atom.ContainerAtom containerAtom=containerAtoms.pop();
    if (containerAtom.type == Atom.TYPE_moov) {
      processMoovAtom(containerAtom);
      containerAtoms.clear();
      parserState=STATE_READING_SAMPLE;
      return false;
    }
 else     if (!containerAtoms.isEmpty()) {
      containerAtoms.peek().add(containerAtom);
    }
  }
  enterReadingAtomHeaderState();
  return seekRequired;
}

Fixed version (ground truth):
/** 
 * Processes the atom payload. If   {@link #atomData} is null and the size is at or above thethreshold  {@link #RELOAD_MINIMUM_SEEK_DISTANCE},   {@code true} is returned and the caller shouldrestart loading at the position in  {@code positionHolder}. Otherwise, the atom is read/skipped.
 */
private boolean readAtomPayload(ExtractorInput input,PositionHolder positionHolder) throws IOException, InterruptedException {
  long atomPayloadSize=atomSize - atomHeaderBytesRead;
  long atomEndPosition=input.getPosition() + atomPayloadSize;
  boolean seekRequired=false;
  if (atomData != null) {
    input.readFully(atomData.data,atomHeaderBytesRead,(int)atomPayloadSize);
    if (atomType == Atom.TYPE_ftyp) {
      isQuickTime=processFtypAtom(atomData);
    }
 else     if (!containerAtoms.isEmpty()) {
      containerAtoms.peek().add(new Atom.LeafAtom(atomType,atomData));
    }
  }
 else {
    if (atomPayloadSize < RELOAD_MINIMUM_SEEK_DISTANCE) {
      input.skipFully((int)atomPayloadSize);
    }
 else {
      positionHolder.position=input.getPosition() + atomPayloadSize;
      seekRequired=true;
    }
  }
  processAtomEnded(atomEndPosition);
  return seekRequired && parserState != STATE_READING_SAMPLE;
}
Program: 110404
Project: 110404
Buggy source:
@Override public void seekToUs(long positionUs){
  if (state == STATE_END_OF_STREAM) {
    state=STATE_SEND_SAMPLE;
  }
}

Fixed version (ground truth):
@Override public void seekToUs(long positionUs){
  if (state == STATE_END_OF_STREAM) {
    pendingResetPositionUs=positionUs;
    state=STATE_SEND_SAMPLE;
  }
}
Program: 110405
Project: 110405
Buggy source:
@Override public TrackStream enable(TrackSelection selection,long positionUs){
  state=STATE_SEND_FORMAT;
  clearCurrentLoadableException();
  maybeStartLoading();
  return this;
}

Fixed version (ground truth):
@Override public TrackStream enable(TrackSelection selection,long positionUs){
  state=STATE_SEND_FORMAT;
  pendingResetPositionUs=NO_RESET;
  clearCurrentLoadableException();
  maybeStartLoading();
  return this;
}
Program: 110406
Project: 110406
Buggy source:
@Override public long readReset(){
  return TrackStream.NO_RESET;
}

Fixed version (ground truth):
@Override public long readReset(){
  long resetPositionUs=pendingResetPositionUs;
  pendingResetPositionUs=NO_RESET;
  return resetPositionUs;
}
Program: 110408
Project: 110408
Buggy source:
@Override protected void parsePayload(ParsableByteArray data,long timeUs){
  int packetType=data.readUnsignedByte();
  if (packetType == AAC_PACKET_TYPE_SEQUENCE_HEADER && !hasOutputFormat) {
    ParsableBitArray adtsScratch=new ParsableBitArray(new byte[data.bytesLeft()]);
    data.readBytes(adtsScratch.data,0,data.bytesLeft());
    int audioObjectType=adtsScratch.readBits(5);
    int sampleRateIndex=adtsScratch.readBits(4);
    int channelConfig=adtsScratch.readBits(4);
    byte[] audioSpecificConfig=CodecSpecificDataUtil.buildAacAudioSpecificConfig(audioObjectType,sampleRateIndex,channelConfig);
    Pair<Integer,Integer> audioParams=CodecSpecificDataUtil.parseAacAudioSpecificConfig(audioSpecificConfig);
    MediaFormat mediaFormat=MediaFormat.createAudioFormat(null,MimeTypes.AUDIO_AAC,MediaFormat.NO_VALUE,MediaFormat.NO_VALUE,getDurationUs(),audioParams.second,audioParams.first,Collections.singletonList(audioSpecificConfig),null);
    output.format(mediaFormat);
    hasOutputFormat=true;
  }
 else   if (packetType == AAC_PACKET_TYPE_AAC_RAW) {
    int bytesToWrite=data.bytesLeft();
    output.sampleData(data,bytesToWrite);
    output.sampleMetadata(timeUs,C.SAMPLE_FLAG_SYNC,bytesToWrite,0,null);
  }
}

Fixed version (ground truth):
@Override protected void parsePayload(ParsableByteArray data,long timeUs){
  int packetType=data.readUnsignedByte();
  if (packetType == AAC_PACKET_TYPE_SEQUENCE_HEADER && !hasOutputFormat) {
    byte[] audioSpecifiConfig=new byte[data.bytesLeft()];
    data.readBytes(audioSpecifiConfig,0,audioSpecifiConfig.length);
    Pair<Integer,Integer> audioParams=CodecSpecificDataUtil.parseAacAudioSpecificConfig(audioSpecifiConfig);
    MediaFormat mediaFormat=MediaFormat.createAudioFormat(null,MimeTypes.AUDIO_AAC,MediaFormat.NO_VALUE,MediaFormat.NO_VALUE,getDurationUs(),audioParams.second,audioParams.first,Collections.singletonList(audioSpecifiConfig),null);
    output.format(mediaFormat);
    hasOutputFormat=true;
  }
 else   if (packetType == AAC_PACKET_TYPE_AAC_RAW) {
    int bytesToWrite=data.bytesLeft();
    output.sampleData(data,bytesToWrite);
    output.sampleMetadata(timeUs,C.SAMPLE_FLAG_SYNC,bytesToWrite,0,null);
  }
}
Program: 110409
Project: 110409
Buggy source:
@Override protected void parsePayload(ParsableByteArray data,long timeUs) throws ParserException {
  int nameType=readAmfType(data);
  if (nameType != AMF_TYPE_STRING) {
    throw new ParserException();
  }
  String name=readAmfString(data);
  if (!NAME_METADATA.equals(name)) {
    return;
  }
  int type=readAmfType(data);
  if (type != AMF_TYPE_ECMA_ARRAY) {
    throw new ParserException();
  }
  Map<String,Object> metadata=readAmfEcmaArray(data);
  if (metadata.containsKey(KEY_DURATION)) {
    double durationSeconds=(double)metadata.get(KEY_DURATION);
    setDurationUs((long)(durationSeconds * C.MICROS_PER_SECOND));
  }
}

Fixed version (ground truth):
@Override protected void parsePayload(ParsableByteArray data,long timeUs) throws ParserException {
  int nameType=readAmfType(data);
  if (nameType != AMF_TYPE_STRING) {
    throw new ParserException();
  }
  String name=readAmfString(data);
  if (!NAME_METADATA.equals(name)) {
    return;
  }
  int type=readAmfType(data);
  if (type != AMF_TYPE_ECMA_ARRAY) {
    throw new ParserException();
  }
  Map<String,Object> metadata=readAmfEcmaArray(data);
  if (metadata.containsKey(KEY_DURATION)) {
    double durationSeconds=(double)metadata.get(KEY_DURATION);
    if (durationSeconds > 0.0) {
      setDurationUs((long)(durationSeconds * C.MICROS_PER_SECOND));
    }
  }
}
Program: 110410
Project: 110410
Buggy source:
@Override public void onResume(){
  super.onResume();
  Intent intent=getIntent();
  contentUri=intent.getData();
  contentType=intent.getIntExtra(CONTENT_TYPE_EXTRA,inferContentType(contentUri,intent.getStringExtra(CONTENT_EXT_EXTRA)));
  contentId=intent.getStringExtra(CONTENT_ID_EXTRA);
  provider=intent.getStringExtra(PROVIDER_EXTRA);
  configureSubtitleView();
  if (player == null) {
    preparePlayer(true);
  }
 else {
    player.setBackgrounded(false);
  }
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  Intent intent=getIntent();
  contentUri=intent.getData();
  contentType=intent.getIntExtra(CONTENT_TYPE_EXTRA,inferContentType(contentUri,intent.getStringExtra(CONTENT_EXT_EXTRA)));
  contentId=intent.getStringExtra(CONTENT_ID_EXTRA);
  provider=intent.getStringExtra(PROVIDER_EXTRA);
  configureSubtitleView();
  if (player == null) {
    if (!maybeRequestPermission()) {
      preparePlayer(true);
    }
  }
 else {
    player.setBackgrounded(false);
  }
}
Program: 110411
Project: 110411
Buggy source:
@Override protected void parsePayload(ParsableByteArray data,long timeUs){
  int packetType=data.readUnsignedByte();
  if (packetType == AAC_PACKET_TYPE_SEQUENCE_HEADER && !hasOutputFormat) {
    ParsableBitArray adtsScratch=new ParsableBitArray(new byte[data.bytesLeft()]);
    data.readBytes(adtsScratch.data,0,data.bytesLeft());
    int audioObjectType=adtsScratch.readBits(5);
    int sampleRateIndex=adtsScratch.readBits(4);
    int channelConfig=adtsScratch.readBits(4);
    byte[] audioSpecificConfig=CodecSpecificDataUtil.buildAacAudioSpecificConfig(audioObjectType,sampleRateIndex,channelConfig);
    Pair<Integer,Integer> audioParams=CodecSpecificDataUtil.parseAacAudioSpecificConfig(audioSpecificConfig);
    MediaFormat mediaFormat=MediaFormat.createAudioFormat(MimeTypes.AUDIO_AAC,MediaFormat.NO_VALUE,MediaFormat.NO_VALUE,durationUs,audioParams.second,audioParams.first,Collections.singletonList(audioSpecificConfig),null);
    output.format(mediaFormat);
    hasOutputFormat=true;
  }
 else   if (packetType == AAC_PACKET_TYPE_AAC_RAW) {
    int bytesToWrite=data.bytesLeft();
    output.sampleData(data,bytesToWrite);
    output.sampleMetadata(timeUs,C.SAMPLE_FLAG_SYNC,bytesToWrite,0,null);
  }
}

Fixed version (ground truth):
@Override protected void parsePayload(ParsableByteArray data,long timeUs){
  int packetType=data.readUnsignedByte();
  if (packetType == AAC_PACKET_TYPE_SEQUENCE_HEADER && !hasOutputFormat) {
    ParsableBitArray adtsScratch=new ParsableBitArray(new byte[data.bytesLeft()]);
    data.readBytes(adtsScratch.data,0,data.bytesLeft());
    int audioObjectType=adtsScratch.readBits(5);
    int sampleRateIndex=adtsScratch.readBits(4);
    int channelConfig=adtsScratch.readBits(4);
    byte[] audioSpecificConfig=CodecSpecificDataUtil.buildAacAudioSpecificConfig(audioObjectType,sampleRateIndex,channelConfig);
    Pair<Integer,Integer> audioParams=CodecSpecificDataUtil.parseAacAudioSpecificConfig(audioSpecificConfig);
    MediaFormat mediaFormat=MediaFormat.createAudioFormat(MediaFormat.NO_VALUE,MimeTypes.AUDIO_AAC,MediaFormat.NO_VALUE,MediaFormat.NO_VALUE,durationUs,audioParams.second,audioParams.first,Collections.singletonList(audioSpecificConfig),null);
    output.format(mediaFormat);
    hasOutputFormat=true;
  }
 else   if (packetType == AAC_PACKET_TYPE_AAC_RAW) {
    int bytesToWrite=data.bytesLeft();
    output.sampleData(data,bytesToWrite);
    output.sampleMetadata(timeUs,C.SAMPLE_FLAG_SYNC,bytesToWrite,0,null);
  }
}
Program: 110414
Project: 110414
Buggy source:
@Override public void enable(int track){
  enabledTrack=tracks.get(track);
  processManifest(currentManifest);
  if (enabledTrack.isAdaptive()) {
    adaptiveFormatEvaluator.enable();
  }
  if (manifestFetcher != null) {
    manifestFetcher.enable();
  }
}

Fixed version (ground truth):
@Override public void enable(int track){
  enabledTrack=tracks.get(track);
  if (enabledTrack.isAdaptive()) {
    adaptiveFormatEvaluator.enable();
  }
  if (manifestFetcher != null) {
    manifestFetcher.enable();
    processManifest(manifestFetcher.getManifest());
  }
 else {
    processManifest(currentManifest);
  }
}
Program: 110415
Project: 110415
Buggy source:
@Override public void onLoadCompleted(int sourceId,long bytesLoaded,int type,int trigger,Format format,int mediaStartTimeMs,int mediaEndTimeMs,long elapsedRealtimeMs,long loadDurationMs){
  if (VerboseLogUtil.isTagEnabled(TAG)) {
    long downloadTime=SystemClock.elapsedRealtime() - loadStartTimeMs[sourceId];
    Log.v(TAG,"String_Node_Str" + getSessionTimeString() + "String_Node_Str"+ sourceId+ "String_Node_Str"+ downloadTime+ "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onLoadCompleted(int sourceId,long bytesLoaded,int type,int trigger,Format format,long mediaStartTimeMs,long mediaEndTimeMs,long elapsedRealtimeMs,long loadDurationMs){
  if (VerboseLogUtil.isTagEnabled(TAG)) {
    long downloadTime=SystemClock.elapsedRealtime() - loadStartTimeMs[sourceId];
    Log.v(TAG,"String_Node_Str" + getSessionTimeString() + "String_Node_Str"+ sourceId+ "String_Node_Str"+ downloadTime+ "String_Node_Str");
  }
}
Program: 110416
Project: 110416
Buggy source:
@Override public void onLoadStarted(int sourceId,long length,int type,int trigger,Format format,int mediaStartTimeMs,int mediaEndTimeMs){
  loadStartTimeMs[sourceId]=SystemClock.elapsedRealtime();
  if (VerboseLogUtil.isTagEnabled(TAG)) {
    Log.v(TAG,"String_Node_Str" + getSessionTimeString() + "String_Node_Str"+ sourceId+ "String_Node_Str"+ type+ "String_Node_Str"+ mediaStartTimeMs+ "String_Node_Str"+ mediaEndTimeMs+ "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onLoadStarted(int sourceId,long length,int type,int trigger,Format format,long mediaStartTimeMs,long mediaEndTimeMs){
  loadStartTimeMs[sourceId]=SystemClock.elapsedRealtime();
  if (VerboseLogUtil.isTagEnabled(TAG)) {
    Log.v(TAG,"String_Node_Str" + getSessionTimeString() + "String_Node_Str"+ sourceId+ "String_Node_Str"+ type+ "String_Node_Str"+ mediaStartTimeMs+ "String_Node_Str"+ mediaEndTimeMs+ "String_Node_Str");
  }
}
Program: 110417
Project: 110417
Buggy source:
@Override public void onVideoFormatEnabled(Format format,int trigger,int mediaTimeMs){
  Log.d(TAG,"String_Node_Str" + getSessionTimeString() + "String_Node_Str"+ format.id+ "String_Node_Str"+ Integer.toString(trigger)+ "String_Node_Str");
}

Fixed version (ground truth):
@Override public void onVideoFormatEnabled(Format format,int trigger,long mediaTimeMs){
  Log.d(TAG,"String_Node_Str" + getSessionTimeString() + "String_Node_Str"+ format.id+ "String_Node_Str"+ Integer.toString(trigger)+ "String_Node_Str");
}
Program: 110418
Project: 110418
Buggy source:
@Override public void onAudioFormatEnabled(Format format,int trigger,int mediaTimeMs){
  Log.d(TAG,"String_Node_Str" + getSessionTimeString() + "String_Node_Str"+ format.id+ "String_Node_Str"+ Integer.toString(trigger)+ "String_Node_Str");
}

Fixed version (ground truth):
@Override public void onAudioFormatEnabled(Format format,int trigger,long mediaTimeMs){
  Log.d(TAG,"String_Node_Str" + getSessionTimeString() + "String_Node_Str"+ format.id+ "String_Node_Str"+ Integer.toString(trigger)+ "String_Node_Str");
}
Program: 110419
Project: 110419
Buggy source:
@Override public void onUpstreamDiscarded(int sourceId,int mediaStartTimeMs,int mediaEndTimeMs){
}

Fixed version (ground truth):
@Override public void onUpstreamDiscarded(int sourceId,long mediaStartTimeMs,long mediaEndTimeMs){
}
Program: 110420
Project: 110420
Buggy source:
void onVideoFormatEnabled(Format format,int trigger,int mediaTimeMs);

Fixed version (ground truth):
void onVideoFormatEnabled(Format format,int trigger,long mediaTimeMs);
Program: 110421
Project: 110421
Buggy source:
@Override public void onLoadStarted(int sourceId,long length,int type,int trigger,Format format,int mediaStartTimeMs,int mediaEndTimeMs){
  if (infoListener != null) {
    infoListener.onLoadStarted(sourceId,length,type,trigger,format,mediaStartTimeMs,mediaEndTimeMs);
  }
}

Fixed version (ground truth):
@Override public void onLoadStarted(int sourceId,long length,int type,int trigger,Format format,long mediaStartTimeMs,long mediaEndTimeMs){
  if (infoListener != null) {
    infoListener.onLoadStarted(sourceId,length,type,trigger,format,mediaStartTimeMs,mediaEndTimeMs);
  }
}
Program: 110422
Project: 110422
Buggy source:
void onAudioFormatEnabled(Format format,int trigger,int mediaTimeMs);

Fixed version (ground truth):
void onAudioFormatEnabled(Format format,int trigger,long mediaTimeMs);
Program: 110423
Project: 110423
Buggy source:
@Override public void onDownstreamFormatChanged(int sourceId,Format format,int trigger,int mediaTimeMs){
  if (infoListener == null) {
    return;
  }
  if (sourceId == TYPE_VIDEO) {
    videoFormat=format;
    infoListener.onVideoFormatEnabled(format,trigger,mediaTimeMs);
  }
 else   if (sourceId == TYPE_AUDIO) {
    infoListener.onAudioFormatEnabled(format,trigger,mediaTimeMs);
  }
}

Fixed version (ground truth):
@Override public void onDownstreamFormatChanged(int sourceId,Format format,int trigger,long mediaTimeMs){
  if (infoListener == null) {
    return;
  }
  if (sourceId == TYPE_VIDEO) {
    videoFormat=format;
    infoListener.onVideoFormatEnabled(format,trigger,mediaTimeMs);
  }
 else   if (sourceId == TYPE_AUDIO) {
    infoListener.onAudioFormatEnabled(format,trigger,mediaTimeMs);
  }
}
Program: 110424
Project: 110424
Buggy source:
@Override public void onLoadCompleted(int sourceId,long bytesLoaded,int type,int trigger,Format format,int mediaStartTimeMs,int mediaEndTimeMs,long elapsedRealtimeMs,long loadDurationMs){
  if (infoListener != null) {
    infoListener.onLoadCompleted(sourceId,bytesLoaded,type,trigger,format,mediaStartTimeMs,mediaEndTimeMs,elapsedRealtimeMs,loadDurationMs);
  }
}

Fixed version (ground truth):
@Override public void onLoadCompleted(int sourceId,long bytesLoaded,int type,int trigger,Format format,long mediaStartTimeMs,long mediaEndTimeMs,long elapsedRealtimeMs,long loadDurationMs){
  if (infoListener != null) {
    infoListener.onLoadCompleted(sourceId,bytesLoaded,type,trigger,format,mediaStartTimeMs,mediaEndTimeMs,elapsedRealtimeMs,loadDurationMs);
  }
}