+ /* Find the next sample from the same stream, assuming there is one;
+ * this is used to calculate the duration below */
+ next_sample_id = film->current_sample + 1;
+ while (next_sample == NULL) {
+ if (next_sample_id >= film->sample_count)
+ break;
+
+ next_sample = &film->sample_table[next_sample_id];
+ if (next_sample->stream != sample->stream) {
+ next_sample = NULL;
+ next_sample_id++;
+ }
+ }
+