Bugfix #1262 additions.
authorRob Haarsma <phaseIV@zonnet.nl>
Fri, 10 Dec 2004 12:55:53 +0000 (12:55 +0000)
committerRob Haarsma <phaseIV@zonnet.nl>
Fri, 10 Dec 2004 12:55:53 +0000 (12:55 +0000)
When the Quicktime movie output path lacks any path indication, the movie is created in the
executable directory.
Also new, when the Quicktime output movie isn't created for some reason, the rendering will
stop and give an error message (in the console).

source/blender/quicktime/apple/quicktime_export.c
source/blender/quicktime/apple/quicktime_import.c

index a55a6ab3e365b6fa8ff53266f67e6668040acbd2..dc5974b283d2416d3473553495604ff07e037a48 100644 (file)
@@ -59,6 +59,7 @@ DONE:
 #include "BKE_global.h"
 #include "BKE_scene.h"
 #include "BLI_blenlib.h"
+#include "BIF_toolbox.h"       /* error() */
 #include "BLO_sys_types.h"
 #include "IMB_imbuf.h"
 #include "IMB_imbuf_types.h"
@@ -69,8 +70,6 @@ DONE:
 #include "quicktime_export.h"
 
 #ifdef _WIN32
-#include <stdio.h>
-#include "BLI_winstuff.h"
 #include <FixMath.h>
 #include <QTML.h>
 #include <TextUtils.h> 
@@ -502,7 +501,6 @@ void start_qt(void) {
        FSRef   myRef;
 #else
        char    *qtname;
-       FILE    *myFile = NULL;
 #endif
 
        if(qte == NULL) qte = MEM_callocN(sizeof(QuicktimeExport), "QuicktimeExport");
@@ -546,7 +544,6 @@ void start_qt(void) {
 #else
                qtname = get_valid_qtname(name);
                sprintf(theFullPath, "%s", qtname);
-               MEM_freeN(qtname);
                
                CopyCStringToPascal(theFullPath, qte->qtfilename);
                err = FSMakeFSSpec(0, 0L, qte->qtfilename, &qte->theSpec);
@@ -560,9 +557,25 @@ void start_qt(void) {
                                                        &qte->theMovie );
                CheckError(err, "CreateMovieFile error");
 
-               printf("Created QuickTime movie: %s\n", qtname);
+               if(err != noErr) {
+                       G.afbreek = 1;
+#ifdef __APPLE__
+                       error("Unable to create Quicktime movie: %s\n", name);
+#else
+                       error("Unable to create Quicktime movie: %s\n", qtname);
+                       MEM_freeN(qtname);
+#endif
+               } else {
+
+#ifdef __APPLE__
+                       printf("Created QuickTime movie: %s\n", name);
+#else
+                       printf("Created QuickTime movie: %s\n", qtname);
+                       MEM_freeN(qtname);
+#endif
 
-               QT_CreateMyVideoTrack();
+                       QT_CreateMyVideoTrack();
+               }
        }
 }
 
index e5359a8b4c036f5d9b25cdd08d0b303ab0936ed2..391da7a7ff704f5b03bf312d7523fb499a4b278a 100644 (file)
@@ -113,12 +113,18 @@ char *get_valid_qtname(char *name)
        if(name[1] != ':') {
                char drive[2];
 
-               drive[0] = Buffer[0];
-               drive[1] = '\0';
-
-               BLI_dynstr_append(ds, drive);
-               BLI_dynstr_append(ds, ":");
-               BLI_dynstr_append(ds, name);
+               if(name[0] != '/' || name[0] != '\\') {
+                       BLI_dynstr_append(ds, Buffer);
+                       BLI_dynstr_append(ds, "/");
+                       BLI_dynstr_append(ds, name);
+               } else {
+                       drive[0] = Buffer[0];
+                       drive[1] = '\0';
+
+                       BLI_dynstr_append(ds, drive);
+                       BLI_dynstr_append(ds, ":");
+                       BLI_dynstr_append(ds, name);
+               }
        } else {
                BLI_dynstr_append(ds, name);
        }