diff options
author | Damien Plisson <damien.plisson@yahoo.fr> | 2009-11-28 21:16:27 +0300 |
---|---|---|
committer | Damien Plisson <damien.plisson@yahoo.fr> | 2009-11-28 21:16:27 +0300 |
commit | 201f789cee84235a47dfc4e1f350f80b90c7fcd0 (patch) | |
tree | 8ad7e9a628a54b80e257dd7cc04142c18ea22310 | |
parent | b3784c475108af9ea19cbc583326bdde14f64592 (diff) |
qtkit : improve thread safety, enforce build on OSX 10.5+
qtkit movie creation functions can be started in a worker thread only from OSX 10.5
-rw-r--r-- | source/blender/quicktime/apple/qtkit_export.m | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/quicktime/apple/qtkit_export.m b/source/blender/quicktime/apple/qtkit_export.m index 9f2a97dee23..6788c22d9a1 100644 --- a/source/blender/quicktime/apple/qtkit_export.m +++ b/source/blender/quicktime/apple/qtkit_export.m @@ -60,6 +60,11 @@ #endif #import <Cocoa/Cocoa.h> #import <QTKit/QTKit.h> + +#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 +#error OSX 10.5 minimum is needed for QTKit +#endif + #endif /* __APPLE__ */ typedef struct QuicktimeExport { @@ -127,9 +132,12 @@ void start_qt(struct Scene *scene, struct RenderData *rd, int rectx, int recty) char name[2048]; - if(qtexport == NULL) qtexport = MEM_callocN(sizeof(QuicktimeExport), "QuicktimeExport"); - if (G.afbreek != 1) { + + if(qtexport == NULL) qtexport = MEM_callocN(sizeof(QuicktimeExport), "QuicktimeExport"); + + [QTMovie enterQTKitOnThread]; + /* Check first if the QuickTime 7.2.1 initToWritableFile: method is available */ if ([[[[QTMovie alloc] init] autorelease] respondsToSelector:@selector(initToWritableFile:error:)] != YES) { G.afbreek = 1; @@ -144,6 +152,7 @@ void start_qt(struct Scene *scene, struct RenderData *rd, int rectx, int recty) if(qtexport->movie == nil) { G.afbreek = 1; NSLog(@"Unable to create quicktime movie : %@",[error localizedDescription]); + [QTMovie exitQTKitOnThread]; } else { [qtexport->movie retain]; [qtexport->filename retain]; @@ -235,6 +244,8 @@ void end_qt(void) [qtexport->frameAttributes release]; [qtexport->movie release]; } + + [QTMovie exitQTKitOnThread]; if(qtexport) { MEM_freeN(qtexport); |