Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Haarsma <phaseIV@zonnet.nl>2004-12-10 04:28:28 +0300
committerRob Haarsma <phaseIV@zonnet.nl>2004-12-10 04:28:28 +0300
commit8b20a8a68597ce35b2216a1eaf57f0cb2d8f51e4 (patch)
treeb3da1391d3b13775766b988d610d7a081886cb1a /source/blender/quicktime/apple/quicktime_import.c
parentb5131b4c6527ece4674273070d23f4ddee38a98f (diff)
Bugfix #1262
Raw fix for the drive letter issue with Quicktime/Windows filenames. When a drive letter is missing in a filename, it'll use the drive where the executable is. Fix might be useful for Yafray too, because the extern char bprogname[]; doesn't return a full path when Blender is started from the console.
Diffstat (limited to 'source/blender/quicktime/apple/quicktime_import.c')
-rw-r--r--source/blender/quicktime/apple/quicktime_import.c48
1 files changed, 46 insertions, 2 deletions
diff --git a/source/blender/quicktime/apple/quicktime_import.c b/source/blender/quicktime/apple/quicktime_import.c
index 4530921aefe..e5359a8b4c0 100644
--- a/source/blender/quicktime/apple/quicktime_import.c
+++ b/source/blender/quicktime/apple/quicktime_import.c
@@ -37,6 +37,7 @@
#include "IMB_anim.h"
#include "BLO_sys_types.h"
#include "BKE_global.h"
+#include "BLI_dynstr.h"
#ifdef __APPLE__
#include <QuickTime/Movies.h>
@@ -99,6 +100,37 @@ void quicktime_exit(void)
}
+#ifdef _WIN32
+char *get_valid_qtname(char *name)
+{
+ TCHAR Buffer[MAX_PATH];
+ DWORD dwRet;
+ char *qtname;
+ DynStr *ds= BLI_dynstr_new();
+
+ dwRet = GetCurrentDirectory(MAX_PATH, Buffer);
+
+ 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);
+ } else {
+ BLI_dynstr_append(ds, name);
+ }
+
+ qtname= BLI_dynstr_get_cstring(ds);
+ BLI_dynstr_free(ds);
+
+ return qtname;
+}
+#endif /* _WIN32 */
+
+
int anim_is_quicktime (char *name)
{
FSSpec theFSSpec;
@@ -111,6 +143,7 @@ int anim_is_quicktime (char *name)
FInfo myFinderInfo;
FSRef myRef;
#else
+ char *qtname;
Str255 dst;
#endif
OSErr err = noErr;
@@ -129,11 +162,16 @@ int anim_is_quicktime (char *name)
if(QTIME_DEBUG) printf("qt: checking as movie\n");
- sprintf(theFullPath, "%s", name);
#ifdef __APPLE__
+ sprintf(theFullPath, "%s", name);
+
err = FSPathMakeRef(theFullPath, &myRef, 0);
err = FSGetCatalogInfo(&myRef, kFSCatInfoNone, NULL, NULL, &theFSSpec, NULL);
#else
+ qtname = get_valid_qtname(name);
+ sprintf(theFullPath, "%s", qtname);
+ MEM_freeN(qtname);
+
CopyCStringToPascal(theFullPath, dst);
err = FSMakeFSSpec(0, 0L, dst, &theFSSpec);
#endif
@@ -349,6 +387,7 @@ int startquicktime (struct anim *anim)
#ifdef __APPLE__
FSRef myRef;
#else
+ char *qtname;
Str255 dst;
#endif
@@ -361,12 +400,17 @@ int startquicktime (struct anim *anim)
}
if(QTIME_DEBUG) printf("qt: attempting to load as movie %s\n", anim->name);
- sprintf(theFullPath, "%s", anim->name);
#ifdef __APPLE__
+ sprintf(theFullPath, "%s", anim->name);
+
err = FSPathMakeRef(theFullPath, &myRef, 0);
err = FSGetCatalogInfo(&myRef, kFSCatInfoNone, NULL, NULL, &theFSSpec, NULL);
#else
+ qtname = get_valid_qtname(anim->name);
+ sprintf(theFullPath, "%s", qtname);
+ MEM_freeN(qtname);
+
CopyCStringToPascal(theFullPath, dst);
FSMakeFSSpec(0, 0L, dst, &theFSSpec);
#endif