X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fproxy.C;fp=cinelerra-5.1%2Fcinelerra%2Fproxy.C;h=9f25a7e1131ca32b0db95594adefa037b539ebbb;hp=5432f478546fb1927cd64e7c20667e843545bb06;hb=559af27994c49da1d98e085f4ac2ec1ad1d1d27c;hpb=4a028c75bea81ad0f03a8004eb076dfff718a469;ds=sidebyside diff --git a/cinelerra-5.1/cinelerra/proxy.C b/cinelerra-5.1/cinelerra/proxy.C index 5432f478..9f25a7e1 100644 --- a/cinelerra-5.1/cinelerra/proxy.C +++ b/cinelerra-5.1/cinelerra/proxy.C @@ -199,6 +199,26 @@ void ProxyDialog::to_proxy() orig_idxbls.append(orig_asset); orig_asset->add_user(); } + for( int i=0,n=edl->nested_edls.size(); inested_edls[i]; + char new_path[BCTEXTLEN]; + if( !ProxyRender::from_proxy_path(new_path, orig_nested, proxy_scale) ) + continue; + proxy_render.to_proxy_path(new_path, orig_nested, proxy_scale); +// test if proxy asset was already added to proxy_assets + int got_it = 0; + for( int i = 0; !got_it && ipath, new_path); + if( got_it ) continue; + Asset *proxy_nested = edl->assets->get_asset(new_path); + if( !proxy_nested ) continue; +// add pointer to existing EDL asset if it exists +// EDL won't delete it unless it's the same pointer. + proxy_assets.append(proxy_nested); + proxy_nested->add_user(); + orig_idxbls.append(orig_nested); + orig_nested->add_user(); + } // convert from the proxy assets to the original assets int proxy_auto_scale = edl->session->proxy_auto_scale; @@ -238,6 +258,19 @@ void ProxyDialog::to_proxy() proxy_render.add_needed(orig, proxy); } } + for( int i=0,n=edl->nested_edls.size(); inested_edls[i]; + Asset *proxy = proxy_render.add_original(orig_nested, new_scale); + if( !proxy ) continue; + int exists = fs.get_size(proxy->path) > 0 ? 1 : 0; + int got_it = exists && // if proxy exists, and is newer than orig_nested + fs.get_date(proxy->path) > fs.get_date(orig_nested->path) ? 1 : 0; + if( !got_it ) { + if( exists ) // prompt user to overwrite + confirm_paths.append(cstrdup(proxy->path)); + proxy_render.add_needed(orig_nested, proxy); + } + } } int result = 0; @@ -291,19 +324,20 @@ void ProxyRender::to_proxy_path(char *new_path, Indexable *indexable, int scale) //printf("ProxyRender::to_proxy_path %d %s %s\n", __LINE__, new_path), asset->path); } -void ProxyRender::from_proxy_path(char *new_path, Asset *asset, int scale) +int ProxyRender::from_proxy_path(char *new_path, Indexable *indexable, int scale) { char prxy[BCTEXTLEN]; int n = sprintf(prxy, ".proxy%d", scale); - strcpy(new_path, asset->path); + strcpy(new_path, indexable->path); char *ptr = strstr(new_path, prxy); - if( !ptr || (ptr[n] != '-' && ptr[n] != '.') ) return; + if( !ptr || (ptr[n] != '-' && ptr[n] != '.') ) return 1; // remove proxy, path.proxy#-sfx.ext => path.sfx char *ext = strrchr(ptr, '.'); if( !ext ) ext = ptr + strlen(ptr); char *cp = ptr + n; for( *cp='.'; cp