|
Revision 9769, 1.9 kB
(checked in by robert, 4 years ago)
|
|
From Riccardo Corsi, "in attach you'll find a patch to cleanup a little bit the (de)initialization code of QuickTime? environment from the quickTime pluging.
It basically removes the static init() and exit() functions,and move them inside the observer class (the one that cleans everything up when the last media is unloaded).
It also add an extra check to clean up on exit if the QuickTime? env is initialized, but no media is succesfully loaded / written (it might happens with streaming resources).
I tested it under WinXP with zero, one and multiple videos.
Stephan reads in copy: could you kindly check if everything runs smooth under OSX as well? Also, have you got a chance to test it with streaming media?
"
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | #include <osg/ref_ptr> |
|---|
| 10 | #include <osg/Referenced> |
|---|
| 11 | #include <osg/Notify> |
|---|
| 12 | #include "QTUtils.h" |
|---|
| 13 | #include "osgDB/Registry" |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | using namespace std; |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | |
|---|
| 23 | OSStatus MakeFSSpecFromPath(const char* path, FSSpec* spec) { |
|---|
| 24 | #ifdef __APPLE__ |
|---|
| 25 | OSStatus err; |
|---|
| 26 | FSRef fsref; |
|---|
| 27 | Boolean isdir; |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | err = FSPathMakeRef((const UInt8*)path, &fsref, &isdir); |
|---|
| 35 | if (err!=0) return err; |
|---|
| 36 | if (isdir) return 1; |
|---|
| 37 | |
|---|
| 38 | err = FSGetCatalogInfo(&fsref, kFSCatInfoNone, NULL, NULL, spec, NULL); |
|---|
| 39 | return err; |
|---|
| 40 | #else |
|---|
| 41 | return -1; |
|---|
| 42 | #endif |
|---|
| 43 | } |
|---|
| 44 | |
|---|
| 45 | |
|---|
| 46 | |
|---|
| 47 | |
|---|
| 48 | OSStatus MakeMovieFromPath(const char* path, Movie* movie, short& resref) { |
|---|
| 49 | OSStatus err; |
|---|
| 50 | FSSpec spec; |
|---|
| 51 | #ifdef __APPLE__ |
|---|
| 52 | MakeFSSpecFromPath(path, &spec); |
|---|
| 53 | #else |
|---|
| 54 | err = NativePathNameToFSSpec((char*)path, &spec, 0 ); |
|---|
| 55 | #endif |
|---|
| 56 | err = OpenMovieFile(&spec, &resref, fsRdPerm); |
|---|
| 57 | if (err!=0) return err; |
|---|
| 58 | err = NewMovieFromFile(movie, resref, NULL, NULL, 0, NULL); |
|---|
| 59 | if (err==0) err=GetMoviesError(); |
|---|
| 60 | return err; |
|---|
| 61 | } |
|---|
| 62 | |
|---|
| 63 | |
|---|