X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fasset.C;h=d8db797b916d868632f89290e8e7b0ca7ae91108;hb=77815ec03df6a03ed75433e8cf8ae1e83fb76d6e;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..d8db797b 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" @@ -87,7 +88,7 @@ int Asset::init_values() ff_video_options[0] = 0; ff_audio_bitrate = 0; ff_video_bitrate = 0; - ff_video_quality = 0; + ff_video_quality = -1; jpeg_quality = 80; aspect_ratio = -1; @@ -319,21 +320,32 @@ 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 = FileSystem::basepath(cp); + delete [] cp; + } + if( *tpath != '/' ) { + char *cp = cstrcat(2, out_path, tpath); + delete [] tpath; tpath = FileSystem::basepath(cp); + delete [] 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 +392,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))