Skip navigation.
 
mlRe: QuickTime Callback
FROM : Michael Hanna
DATE : Sat Nov 06 19:22:19 2004

I see, is it possible that there may be a flaw in how I'm 
encoding/decoding my object in the loadRepresentationFromData:[sic, 
should be loadDataRepresentation:] method? I did a once-over of the 
object and it looks OK...

- (BOOL)loadDataRepresentation:(NSData *)data ofType:(NSString *)aType
{
    //int _prompterRetainCount = [prompter retainCount];
   
   // Insert code here to read your document from the given data.  You 
can also choose to override -loadFileWrapperRepresentation:ofType: or 
-readFromFile:ofType: instead.
   //NSLog(@"loadDataRepresentation:");
   //[prompter release];
   //_prompterRetainCount = [prompter retainCount];
   
   prompter = [[NSUnarchiver unarchiveObjectWithData:data] retain];
   
   //_prompterRetainCount = [prompter retainCount];
   
   if([[prompter visualPromptPath] isNotEqualTo:@"none selected"])
       [self _readVisualFile];
   
   if([[prompter auralPromptPath] isNotEqualTo:@"none selected"])
       [self _readAuralFile];
   [self updateUI];
   return YES;
}


the callback is actually created in the _readAuralFile method:

- (void)_readAuralFile
{
   myMovie = [[NSMovie alloc] initWithURL:[NSURL 
fileURLWithPath:[prompter auralPromptPath]] byReference:NO];
   [myMovieView setMovie:myMovie];
   [myMovie release];
   [self setupMoviePlayingCompleteCallback:[[myMovieView movie] QTMovie] 
callbackUPP:gMoviePlayingCompleteCallBack]; // ** callback created here 
** //    
   [myVolumeSlider setDoubleValue: GetMovieVolume([[myMovieView movie] 
QTMovie])];
   [myMainSlider setMaxValue:GetMovieDuration([[myMovieView movie] 
QTMovie])];
   [myMainSlider setDoubleValue:0.0];
}

like I mentioned before, the _readAuralFile is also called from another 
action and no error takes place.
I've also tried commenting-out [myMovie release]; and same problem 
occurs. Thanks for you help so far.

Michael

On 6-Nov-04, at 8:57 AM, Darrin Cardani wrote:

> At 8:09 PM -0800 11/5/04, Michael Hanna <<email_removed>> wrote:

>> This happens in MyDocument.m when I load a pre-existing document(i.e.
>> from the Open Recent... menu item) and does the
>> loadRepresentationFromData: method.
>>
>> If I load the movie via my Import Movie... menu item, which runs the
>> exact same code(but does not use loadRepresentationFromData:), I get 
>> no
>> error(!)

>
> It certainly looks like everything's OK, assuming theMovie isn't NULL, 
> and other obvious things like that. Since it only happens when 
> loadRepresentationFromData: is called, it sounds almost like something 
> in that method is messing up the heap or stack, but you aren't seeing 
> it until later when you set the callback.
>
> Darrin
> -- 
> Darrin Cardani - <email_removed>
> President, Buena Software, Inc.
> <http://www.buena.com/>
> Video, Image and Audio Processing Development
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list      (<email_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/
> <email_removed>
>
> This email sent to <email_removed>
>

Related mailsAuthorDate
mlQuickTime Callback Michael Hanna Nov 6, 04:27
mlRe: QuickTime Callback Darrin Cardani Nov 6, 14:57
mlRe: QuickTime Callback Michael Hanna Nov 6, 16:46
mlRe: QuickTime Callback Michael Hanna Nov 6, 19:22
mlRe: QuickTime Callback Darrin Cardani Nov 8, 04:05