X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fasset.C;h=fd17a1422a89b9bfdcca138e25f47ab5085b9f85;hb=101d92b4c50a831fb00edd65df57de41b408c7b6;hp=9cf4a3055e69c9f61010d901ad077585dd28f633;hpb=49f85559268fc040fe7ba5611cc0520793cf728b;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/asset.C b/cinelerra-5.1/cinelerra/asset.C index 9cf4a305..fd17a142 100644 --- a/cinelerra-5.1/cinelerra/asset.C +++ b/cinelerra-5.1/cinelerra/asset.C @@ -25,6 +25,7 @@ #include "bchash.h" #include "bcsignals.h" #include "clip.h" +#include "cstrdup.h" #include "edl.h" #include "file.h" #include "filesystem.h" @@ -319,21 +320,30 @@ char* Asset::get_compression_text(int audio, int video) return 0; } -Asset& Asset::operator=(Asset &asset) +int Asset::equivalent(Asset &asset, int test_audio, int test_video, EDL *edl) { -printf("Asset::operator=\n"); - copy_location(&asset); - copy_format(&asset, 1); - return *this; -} - - -int Asset::equivalent(Asset &asset, - int test_audio, - int test_video) -{ - int result = (!strcmp(asset.path, path) && - format == asset.format); + int result = format == asset.format ? 1 : 0; + if( result && strcmp(asset.path, path) ) { + char *out_path = edl ? FileSystem::basepath(edl->path) : 0; + char *sp = out_path ? strrchr(out_path,'/') : 0; + if( sp ) *++sp = 0; + char *apath = FileSystem::basepath(asset.path); + char *tpath = FileSystem::basepath(this->path); + if( out_path ) { + if( *apath != '/' ) { + char *cp = cstrcat(2, out_path, apath); + delete [] apath; apath = cp; + } + if( *tpath != '/' ) { + char *cp = cstrcat(2, out_path, tpath); + delete [] tpath; tpath = cp; + } + } + if( strcmp(apath, tpath) ) result = 1; + delete [] apath; + delete [] tpath; + delete [] out_path; + } if(result && format == FILE_FFMPEG) result = !strcmp(fformat, asset.fformat); @@ -380,19 +390,6 @@ int Asset::equivalent(Asset &asset, return result; } -int Asset::operator==(Asset &asset) -{ - - return equivalent(asset, - 1, - 1); -} - -int Asset::operator!=(Asset &asset) -{ - return !(*this == asset); -} - int Asset::test_path(const char *path) { if(!strcasecmp(this->path, path))