+ /* We can't use the given time stamps. Previous frames
+ might already have been extended, throwing off the
+ raw values fed to render.c. Instead, their
+ stop and start times are stored in arrays.
+ The 4th cached frame will be the to use.
+ If it needed its duration extended to make up
+ lost time, it will have happened above. */
+ ivtc_buffer->start = pv->last_start[3];
+ ivtc_buffer->stop = pv->last_stop[3];
+
+ /* Set the 3rd cached frame to start when this one stops,
+ and so on down the line. If any of them need to be
+ extended as well to make up lost time, it'll be handled
+ on the next loop through the renderer. */
+ int i;
+ for (i = 2; i >= 0; i--)
+ {
+ int temp_duration = pv->last_stop[i] - pv->last_start[i];
+ pv->last_start[i] = pv->last_stop[i+1];
+ pv->last_stop[i] = pv->last_start[i] + temp_duration;
+ }
+
+ /* If we have a pending chapter mark and this frame is at
+ or after the time of the mark, mark this frame & clear
+ our pending mark. */
+ if( pv->chapter_time && pv->chapter_time <= ivtc_buffer->start )
+ {
+ ivtc_buffer->new_chap = pv->chapter_val;
+ pv->chapter_time = 0;
+ }
+