- int64_t source_frame = project_frame + edit->startsource;
- source_frame = speed_autos->automation_integral(0, source_frame, PLAY_FORWARD);
- VFrame *picon_frame = 0;
- Indexable *indexable = edit->get_source();
- int use_cache = 0;
- int id = -1;
-
- id = indexable->id;
-
- if( id >= 0 ) {
- picon_frame = mwindow->frame_cache->get_frame_ptr(source_frame, edit->channel,
- mwindow->edl->session->frame_rate, BC_RGB888, picon_w, picon_h, id);
- }
-
- if( picon_frame != 0 ) {
- use_cache = 1;
- }
- else {
-// Set picon thread to draw in background
- if( mode != IGNORE_THREAD ) {
-// printf("ResourcePixmap::draw_video_resource %d %d %lld\n",
-// __LINE__,
-// mwindow->frame_cache->total(),
-// source_frame);
- gui->resource_thread->add_picon(this, canvas->pane->number, x, y,
- picon_w, picon_h, mwindow->edl->session->frame_rate,
- source_frame, edit->channel, indexable);
- }
- }
-
- if( picon_frame )
+ int64_t edit_position =
+ edit->track->to_units((x + pixmap_x - edit_x) * project_zoom, 0);
+ int64_t speed_position = edit->startsource;
+ speed_position += !speed_autos ? edit_position :
+ speed_autos->automation_integral(
+ edit->startproject, edit_position, PLAY_FORWARD);
+ VFrame *picon_frame = indexable->id < 0 ? 0 :
+ mwindow->frame_cache->get_frame_ptr(speed_position, edit->channel,
+ mwindow->edl->session->frame_rate, BC_RGB888,
+ picon_w, picon_h, indexable->id);
+ if( picon_frame ) {