fit keyframe spanning for sketcher,tracer,crikey, rework keyframegui preset, tweak...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / cache.C
index de8563a96e26013cdcb599b34e29c5651847bf37..4c94adbfe78ba4f6a0616cd21094155b53a3df02 100644 (file)
@@ -82,8 +82,8 @@ File* CICache::check_out(Asset *asset, EDL *edl, int block)
                        current = new CICacheItem(this, edl, asset);
                        append(current);  current->checked_out = tid;
                        file = current->file;
-                       total_lock->unlock();
                        int result = file->open_file(preferences, asset, 1, 0);
+                       total_lock->unlock();
                        if( result ) {
 SET_TRACE
                                delete file;
@@ -125,8 +125,9 @@ SET_TRACE
 int CICache::check_in(Asset *asset)
 {
        total_lock->lock("CICache::check_in");
+       CICacheItem *current = 0;
        if( !check_outs ) {
-               CICacheItem *current = first;
+               current = first;
                while(current && strcmp(current->asset->path, asset->path) != 0)
                        current = NEXT;
                if(current && current->checked_out) {
@@ -272,16 +273,16 @@ int CICache::delete_oldest()
        return result;
 }
 
-void CICache::dump()
+void CICache::dump(FILE *fp)
 {
        CICacheItem *current;
        total_lock->lock("CICache::dump");
-       printf("CICache::dump total size %jd\n", get_memory_usage(0));
+       fprintf(fp, "CICache::dump total size %jd\n", get_memory_usage(0));
        for(current = first; current; current = NEXT)
        {
-               printf("cache item %p asset %p %s age=%d\n",
-                       current, current->asset,
-                       current->asset->path, current->age);
+               fprintf(fp, "cache item %p asset %p %s age=%d checked_out=%p\n",
+                       current, current->asset, current->asset->path,
+                       current->age, (void*)current->checked_out);
        }
        total_lock->unlock();
 }