Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Flash importer component hangs when I feed it an empty file.



Howdy, programmers!

I have this applicantion going on. I have files comming in, and I can't trust their windows name extention. For example I can have a GIF-encoded file with extention ".lol".

So I am iterating over some set of importer components and with every one of them I try to import the file to a movie (MovieImportFile() function).

I expect that there will be all kinds of files comming in, including ones that will not be opened by no importer components. When I try it on an empty file, I m experiencing problems with flash importer. It hangs. Is there any way to abort the operation?

My program hangs in this function when enFileType = kQTFileTypeFlash and objFileSpec designates a file of size 0.

BOOL OpenFileOfType( OSType enFileType, FSSpec & objFileSpec, Movie & objMovie )
{
ComponentInstance objCompInst = OpenDefaultComponent( MovieImportType, enFileType );
if ( objCompInst == NULL )
return FALSE;


   objMovie = NewMovie( newMovieActive );
   Track pUsedTrack = 0;
   TimeValue intAddedDuration;
   long intInFlags = movieImportCreateTrack, intOutFlags = 0;

   /* Hangs on the FOLLOWING CALL */
   OSErr intError = (OSErr)MovieImportFile(
       (MovieImportComponent)objCompInst,
       &objFileSpec,
       objMovie,
       NULL, /* not specifying target track */
       &pUsedTrack,
       (TimeValue)0,
       &intAddedDuration,
       intInFlags,
       &intOutFlags
       );

   CloseComponent( objCompInst );

   if ( intError == noErr )
       return TRUE;
   else
   {
       if (objMovie)
       {
           DisposeMovie( objMovie );
           objMovie = NULL;
       }
       return FALSE;
   }
};

Ow help me help me. Thank you!

_______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.