docs: protected void createTrun(long startSample, long endSample, Track track, int sequenceNumber, TrackFragmentBox parent) {
          TrackRunBox trun = new TrackRunBox();
          trun.setVersion(1);
          long[] sampleSizes = getSampleSizes(startSample, endSample, track, sequenceNumber);
  
          trun.setSampleDurationPresent(true);
          trun.setSampleSizePresent(true);
          List<TrackRunBox.Entry> entries = new ArrayList<TrackRunBox.Entry>(l2i(endSample - startSample));
  
  
          List<CompositionTimeToSample.Entry> compositionTimeEntries = track.getCompositionTimeEntries();
          int compositionTimeQueueIndex = 0;
          CompositionTimeToSample.Entry[] compositionTimeQueue =
                  compositionTimeEntries != null && compositionTimeEntries.size() > 0 ?
                          compositionTimeEntries.toArray(new CompositionTimeToSample.Entry[compositionTimeEntries.size()]) : null;
          long compositionTimeEntriesLeft = compositionTimeQueue != null ? compositionTimeQueue[compositionTimeQueueIndex].getCount() : -1;
  
  
          trun.setSampleCompositionTimeOffsetPresent(compositionTimeEntriesLeft > 0);
  
          // fast forward composition stuff
          for (long i = 1; i < startSample; i++) {
              if (compositionTimeQueue != null) {
                  //trun.setSampleCompositionTimeOffsetPresent(true);
                  if (--compositionTimeEntriesLeft == 0 && (compositionTimeQueue.length - compositionTimeQueueIndex) > 1) {
                      compositionTimeQueueIndex++;
                      compositionTimeEntriesLeft = compositionTimeQueue[compositionTimeQueueIndex].getCount();
                  }
              }
          }
  
          boolean sampleFlagsRequired = (track.getSampleDependencies() != null && !track.getSampleDependencies().isEmpty() ||
                  track.getSyncSamples() != null && track.getSyncSamples().length != 0);
  
          trun.setSampleFlagsPresent(sampleFlagsRequired);
  
          for (int i = 0; i < sampleSizes.length; i++) {
              TrackRunBox.Entry entry = new TrackRunBox.Entry();
              entry.setSampleSize(sampleSizes[i]);
              if (sampleFlagsRequired) {
                  //if (false) {
                  SampleFlags sflags = new SampleFlags();
  
                  if (track.getSampleDependencies() != null && !track.getSampleDependencies().isEmpty()) {
                      SampleDependencyTypeBox.Entry e = track.getSampleDependencies().get(i);
                      sflags.setSampleDependsOn(e.getSampleDependsOn());
                      sflags.setSampleIsDependedOn(e.getSampleIsDependedOn());
                      sflags.setSampleHasRedundancy(e.getSampleHasRedundancy());
                  }
                  if (track.getSyncSamples() != null && track.getSyncSamples().length > 0) {
                      // we have to mark non-sync samples!
                      if (Arrays.binarySearch(track.getSyncSamples(), startSample + i) >= 0) {
                          sflags.setSampleIsDifferenceSample(false);
                          sflags.setSampleDependsOn(2);
                      } else {
                          sflags.setSampleIsDifferenceSample(true);
                          sflags.setSampleDependsOn(1);
                      }
                  }
                  // i don't have sample degradation
                  entry.setSampleFlags(sflags);
  
              }
  
              entry.setSampleDuration(track.getSampleDurations()[l2i(startSample + i - 1)]);
  
              if (compositionTimeQueue != null) {
                  entry.setSampleCompositionTimeOffset(compositionTimeQueue[compositionTimeQueueIndex].getOffset());
                  if (--compositionTimeEntriesLeft == 0 && (compositionTimeQueue.length - compositionTimeQueueIndex) > 1) {
                      compositionTimeQueueIndex++;
                      compositionTimeEntriesLeft = compositionTimeQueue[compositionTimeQueueIndex].getCount();
                  }
              }
              entries.add(entry);
          }
  
          trun.setEntries(entries);
  
          parent.addBox(trun);
      }