X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fproxy.C;h=45feb5951354a36d5e668f73080483ddc6ababba;hp=b534a10e174e0fe5b72a2b29ac8d21ef579b4d6f;hb=502b6f3b6fd04f6b01c6d70dcb81aa304dd0db1c;hpb=5621db270ccbeabc106e0f438941dba6f930652b diff --git a/cinelerra-5.1/cinelerra/proxy.C b/cinelerra-5.1/cinelerra/proxy.C index b534a10e..45feb595 100644 --- a/cinelerra-5.1/cinelerra/proxy.C +++ b/cinelerra-5.1/cinelerra/proxy.C @@ -161,6 +161,10 @@ void ProxyDialog::calculate_sizes() void ProxyDialog::handle_close_event(int result) { if( result ) return; + if( !File::renders_video(asset) ) { + eprintf("Specified format does not render video"); + return; + } mwindow->edl->session->proxy_use_scaler = use_scaler; mwindow->edl->session->proxy_auto_scale = auto_scale; mwindow->edl->session->proxy_beep = beep; @@ -260,13 +264,15 @@ Asset *ProxyRender::add_original(Indexable *idxbl, int new_scale) if( !proxy ) { proxy = new Asset(new_path); // new compression parameters - if( idxbl->get_video_frames() < 0 ) { + int64_t video_frames = idxbl->get_video_frames(); + if( video_frames < 0 ) { proxy->format = FILE_PNG; proxy->png_use_alpha = 1; proxy->video_length = -1; } else { proxy->copy_format(format_asset, 0); + proxy->video_length = video_frames; } proxy->awindow_folder = AW_PROXY_FOLDER; proxy->audio_data = 0; @@ -279,9 +285,7 @@ Asset *ProxyRender::add_original(Indexable *idxbl, int new_scale) if( proxy->height & 1 ) ++proxy->height; proxy->actual_height = proxy->height; proxy->frame_rate = idxbl->get_frame_rate(); - edl_assets->append(proxy); } - proxy->add_user(); orig_proxies.append(proxy); idxbl->add_user(); orig_idxbls.append(idxbl); @@ -658,6 +662,7 @@ void ProxyClient::process_package(LoadPackage *ptr) result = dst_file.open_file(preferences, proxy, 0, 1); if( result ) { proxy_render->failed = 1; + ::remove(proxy->path); return; } @@ -707,6 +712,8 @@ void ProxyClient::process_package(LoadPackage *ptr) mwindow->mainindexes->add_next_asset(0, asset); mwindow->mainindexes->start_build(); } + else + ::remove(proxy->path); }