Fix #30315: Temporary proxy files are not erased and old proxys are not updated if...
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 23 Feb 2012 10:18:10 +0000 (10:18 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 23 Feb 2012 10:18:10 +0000 (10:18 +0000)
Two issues are fixed here:
- On windows rename() doesn't actually renames file if destination file is already exist.
  Solved by ulinking previously built proxy/timecode.
- IMB_TC_MAX_SLOT was set to incorrect value leading to record run timecode calculating
  several times.

source/blender/imbuf/IMB_imbuf.h
source/blender/imbuf/intern/indexer.c

index 9d21cc6d8d98f0b5a200759b9d3e363e11e9f2c8..5f38142726f8459f3d3fc1647687f1495467f614 100644 (file)
@@ -199,7 +199,7 @@ typedef enum IMB_Timecode_Type {
                                  device (*every* consumer camcorder can do
                                  that :) )*/
        IMB_TC_RECORD_RUN_NO_GAPS = 8,
-       IMB_TC_MAX_SLOT   = 8
+       IMB_TC_MAX_SLOT   = 4
 } IMB_Timecode_Type;
 
 typedef enum IMB_Proxy_Size {
index ade63aa1e9c43c217d4e0ff400ff3d7ad0c6bb56..f36db61f27a079b49f98ad4f68de3c4b72c022de 100644 (file)
@@ -147,6 +147,7 @@ void IMB_index_builder_finish(anim_index_builder * fp, int rollback)
        if (rollback) {
                unlink(fp->temp_name);
        } else {
+               unlink(fp->name);
                rename(fp->temp_name, fp->name);
        }
 
@@ -687,6 +688,7 @@ static void free_proxy_output_ffmpeg(struct proxy_output_ctx * ctx,
        } else {
                get_proxy_filename(ctx->anim, ctx->proxy_size, 
                                   fname, FALSE);
+               unlink(fname);
                rename(fname_tmp, fname);
        }
        
@@ -1043,6 +1045,7 @@ static void index_rebuild_fallback(struct anim * anim,
                        if (*stop) {
                                unlink(fname_tmp);
                        } else {
+                               unlink(fname);
                                rename(fname_tmp, fname);
                        }
                }