X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fawindowgui.C;h=33e3cbc8bd33a7aa93513a6c368797deb23e52da;hb=9a75aafbc51be29b49351a51e9084bb34d255c0d;hp=1aa57e35b5ebf3eeb42ede875813adb50ec7a509;hpb=86c9537e0540010ff43b16feb4cd7de98409eba1;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/awindowgui.C b/cinelerra-5.1/cinelerra/awindowgui.C index 1aa57e35..33e3cbc8 100644 --- a/cinelerra-5.1/cinelerra/awindowgui.C +++ b/cinelerra-5.1/cinelerra/awindowgui.C @@ -114,6 +114,8 @@ AssetVIcon::AssetVIcon(AssetPicon *picon, int w, int h, double framerate, int64_ AssetVIcon::~AssetVIcon() { + if( picon->gui->vicon_thread->solo == this ) + picon->gui->vicon_thread->solo = 0; picon->gui->vicon_thread->del_vicon(this); delete temp; } @@ -162,29 +164,30 @@ VFrame *AssetVIcon::frame() } if( seq_no >= images.size() ) { MWindow *mwindow = picon->mwindow; - File *file = mwindow->video_cache->check_out(asset, mwindow->edl, 1); - if( !file ) { - broken = 1; - return 0; - } if( temp && (temp->get_w() != asset->width || temp->get_h() != asset->height) ) { delete temp; temp = 0; } if( !temp ) temp = new VFrame(0, -1, asset->width, asset->height, BC_RGB888, -1); - while( seq_no >= images.size() ) { - mwindow->video_cache->check_in(asset); - Thread::yield(); - file = mwindow->video_cache->check_out(asset, mwindow->edl, 0); - if( !file ) { usleep(1000); continue; } - file->set_layer(0); + File *file = mwindow->video_cache->check_out(asset, mwindow->edl, 1); + while( file && seq_no >= images.size() && !avt->interrupted ) { int64_t pos = images.size() / picon->gui->vicon_thread->refresh_rate * frame_rate; file->set_video_position(pos,0); + file->set_layer(0); if( file->read_frame(temp) ) temp->clear_frame(); add_image(temp, vw, vh, vicon_cmodel); + mwindow->video_cache->check_in(asset); + Thread::yield(); + file = 0; + for( int retries=1000; !file && --retries>=0; usleep(10000) ) { + if( avt->interrupted ) return 0; + file = mwindow->video_cache->check_out(asset, mwindow->edl, 0); + } } + if( !file ) { broken = 1; return 0; } mwindow->video_cache->check_in(asset); } + if( seq_no >= images.size() ) return 0; return *images[seq_no]; } @@ -534,7 +537,7 @@ void AssetViewPopup::draw_vframe(VFrame *vframe) double total_length = edl->tracks->total_length(); if( !total_length ) total_length = 1; for( Track *track=edl->tracks->first; track!=0; track=track->next ) { - if( !track->record ) continue; + if( !track->is_armed() ) continue; for( Edit *edit=track->edits->first; edit!=0; edit=edit->next ) { Indexable *indexable = (Indexable *)edit->asset; if( !indexable ) indexable = (Indexable *)edit->nested_edl;