if( !temp )
temp = new VFrame(0, -1, asset->width, asset->height, BC_RGB888, -1);
File *file = mwindow->video_cache->check_out(asset, mwindow->edl, 1);
if( !temp )
temp = new VFrame(0, -1, asset->width, asset->height, BC_RGB888, -1);
File *file = mwindow->video_cache->check_out(asset, mwindow->edl, 1);
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);
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);
- file = 0;
- for( int retries=1000; !file && --retries>=0; usleep(10000) )
+ file = mwindow->video_cache->check_out(asset, mwindow->edl, 0);
+ for( int retries=10; !file && --retries>=0; usleep(1000) ) {
+ if( avt->interrupted ) return 0;
double total_length = edl->tracks->total_length();
if( !total_length ) total_length = 1;
for( Track *track=edl->tracks->first; track!=0; track=track->next ) {
double total_length = edl->tracks->total_length();
if( !total_length ) total_length = 1;
for( Track *track=edl->tracks->first; track!=0; track=track->next ) {
for( Edit *edit=track->edits->first; edit!=0; edit=edit->next ) {
Indexable *indexable = (Indexable *)edit->asset;
if( !indexable ) indexable = (Indexable *)edit->nested_edl;
for( Edit *edit=track->edits->first; edit!=0; edit=edit->next ) {
Indexable *indexable = (Indexable *)edit->asset;
if( !indexable ) indexable = (Indexable *)edit->nested_edl;
+ char string[BCTEXTLEN];
+ sprintf(string, _("Reading %s"), name);
+ mwindow->gui->lock_window("AssetPicon::create_objects");
+ mwindow->gui->show_message(string);
+ mwindow->gui->unlock_window();
- { char string[BCTEXTLEN];
- sprintf(string, _("Reading %s"), name);
- mwindow->gui->lock_window("AssetPicon::create_objects");
- mwindow->gui->show_message(string);
- mwindow->gui->unlock_window(); }
char path[BCTEXTLEN];
int proxy_scale = mwindow->edl->session->proxy_scale;
ProxyRender::from_proxy_path(path, proxy_asset, proxy_scale);
char path[BCTEXTLEN];
int proxy_scale = mwindow->edl->session->proxy_scale;
ProxyRender::from_proxy_path(path, proxy_asset, proxy_scale);
- Asset *unproxy_asset = mwindow->edl->assets->get_asset(path);
- if( !unproxy_asset || !unproxy_asset->layers ) return 0;
+ Indexable *unproxy_idxbl =
+ proxy_asset->proxy_edl ?
+ (Indexable *) mwindow->edl->get_nested_edl(path) :
+ (Indexable *) mwindow->edl->assets->get_asset(path);
+ if( !unproxy_idxbl || !unproxy_idxbl->get_video_layers() ) return 0;
// make a clip from proxy video tracks and unproxy audio tracks
EDL *proxy_edl = new EDL(mwindow->edl);
proxy_edl->create_objects();
// make a clip from proxy video tracks and unproxy audio tracks
EDL *proxy_edl = new EDL(mwindow->edl);
proxy_edl->create_objects();
strcpy(proxy_edl->local_session->clip_title, path);
strcpy(proxy_edl->local_session->clip_notes, _("Proxy clip"));
proxy_edl->session->video_tracks = proxy_asset->layers;
strcpy(proxy_edl->local_session->clip_title, path);
strcpy(proxy_edl->local_session->clip_notes, _("Proxy clip"));
proxy_edl->session->video_tracks = proxy_asset->layers;
proxy_edl->create_default_tracks();
double length = proxy_asset->frame_rate > 0 ?
( proxy_asset->video_length >= 0 ?
proxy_edl->create_default_tracks();
double length = proxy_asset->frame_rate > 0 ?
( proxy_asset->video_length >= 0 ?
if( current->data_type != TRACK_VIDEO ) continue;
current->insert_asset(proxy_asset, 0, length, 0, vtrack++);
}
if( current->data_type != TRACK_VIDEO ) continue;
current->insert_asset(proxy_asset, 0, length, 0, vtrack++);
}
- length = (double)unproxy_asset->audio_length / unproxy_asset->sample_rate;
+ int64_t samples = unproxy_idxbl->get_audio_samples();
+ int sample_rate = unproxy_idxbl->get_sample_rate();
+ length = sample_rate > 0 ? (double)samples / sample_rate : 0;
current = proxy_edl->tracks->first;
for( int atrack=0; current; current=NEXT ) {
if( current->data_type != TRACK_AUDIO ) continue;
current = proxy_edl->tracks->first;
for( int atrack=0; current; current=NEXT ) {
if( current->data_type != TRACK_AUDIO ) continue;
- current->insert_asset(unproxy_asset, 0, length, 0, atrack++);
+ Asset *asset = unproxy_idxbl->is_asset ? (Asset *)unproxy_idxbl : 0;
+ EDL *nested_edl = unproxy_idxbl->is_asset ? 0 : (EDL *)unproxy_idxbl;
+ current->insert_asset(asset, nested_edl, length, 0, atrack++);
Indexable *indexable = result->indexable;
if( proxy && indexable && indexable->is_asset &&
indexable->folder_no == AW_PROXY_FOLDER ) {
Indexable *indexable = result->indexable;
if( proxy && indexable && indexable->is_asset &&
indexable->folder_no == AW_PROXY_FOLDER ) {