Hi All -
I'm running in to a disturbing failure with QTKit, I have a simple command line utility that trims N number of seconds from the beginning of a QTMovie object, and then writes that QTMovie object back to disk (to a new file).
The code compiles and runs flawlessly. The executable runs exactly as intended from the command line, provided that I run less than say, 10 instances simultaneously. If additional instances are running, two errors crop up in STDERR:
This utility is intended to be used with a very large corporate library of media files (all valid Quicktime mov's)
- and *anywhere from 1 to 1000 instances of the utility running at any one time is absolutely required.*
The "important code" is below:
Any help or insight would be GREATLY appreciated!
-James Heliker
james.heliker@gmail.com
I'm running in to a disturbing failure with QTKit, I have a simple command line utility that trims N number of seconds from the beginning of a QTMovie object, and then writes that QTMovie object back to disk (to a new file).
The code compiles and runs flawlessly. The executable runs exactly as intended from the command line, provided that I run less than say, 10 instances simultaneously. If additional instances are running, two errors crop up in STDERR:
Code:
QTKitServer(94967,0xb038d000) malloc: *** error for object 0xffda: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Code:
QTKitServer(95112,0xb0185000) malloc: *** error for object 0x221220: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
This utility is intended to be used with a very large corporate library of media files (all valid Quicktime mov's)
- and *anywhere from 1 to 1000 instances of the utility running at any one time is absolutely required.*
The "important code" is below:
Code:
NSNumber *yes = [NSNumber numberWithBool:YES];
NSDictionary *attrbs = [NSDictionary dictionaryWithObjectsAndKeys:
inputFilePath, QTMovieFileNameAttribute,
yes, QTMovieEditableAttribute,
nil];
QTMovie *movie = [[QTMovie alloc] initWithAttributes: attrbs error: nil];
long seconds = strtoull([secondsVal UTF8String], NULL, 0);
QTTime startTime = QTMakeTime(0, 1);
QTTime duration = QTMakeTime(seconds, 1);
QTTimeRange range = QTMakeTimeRange(startTime, duration);
[movie deleteSegment: range];
[NSDictionary *writeDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
yes, QTMovieFlatten,
nil];
[movie writeToFile: outputFilePath withAttributes: writeDictionary error: nil];
movie = nil;
[movie release];
Any help or insight would be GREATLY appreciated!
-James Heliker
james.heliker@gmail.com