harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp
changeset 52 40db28bb26b8
parent 45 a93990e5815e
child 56 fd6cce931a8a
--- a/harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp	Wed Aug 18 10:12:07 2010 +0300
+++ b/harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp	Thu Sep 02 20:52:02 2010 +0300
@@ -339,7 +339,7 @@
     if ( error != KErrNone )
         {
         WRITELOG1( "CHarvesterVideoPlugin::GetObjectType - File open error: %d", error );
-        if( error == KErrInUse )
+        if( error == KErrInUse || KErrLocked )
             {
 #ifdef _DEBUG
             TPtrC fileName( aUri.Mid(2) );
@@ -627,6 +627,7 @@
         TRAP( error, helixMetadata->OpenFileL( file ) );        
 
         // No need for the file handle anymore so closing it
+        WRITELOG( "CHarvesterVideoPlugin - Parsing done, file handle can be closed" );   
         file.Close();
         
         if ( error == KErrNone )
@@ -981,7 +982,7 @@
             }
 #endif
         }
-    WRITELOG( "CHarvesterVideoPlugin - Closing file" );        
+    WRITELOG( "CHarvesterVideoPlugin - Closing file, if still open" );        
     CleanupStack::PopAndDestroy( &file );        
 
 #ifdef _DEBUG
@@ -1247,6 +1248,7 @@
     CleanupStack::PushL( helixMetadata );
     
 	TRAPD( err, helixMetadata->OpenFileL( aFile ) );
+	aFile.Close();
 
 	if( err == KErrNone )
 		{
@@ -1273,10 +1275,10 @@
 	
 		const TInt mimeCount = mimes.Count();
 		
-		// at least one MIME type must be found
+		// Set to Video, regardless how badly file is corrupted
 		if( mimeCount == 0 )
 			{
-			User::Leave( KErrNotFound );
+		    aType.Copy( KVideo );
 			}
 	
 		for( TInt i = 0; i < mimeCount; i++ )
@@ -1336,8 +1338,7 @@
     if( blackListError == KErrNone )
         {
         RemoveFileFromBlackList( tempName, mediaId );
-        }
-    
+        }  
 	}
 
 TInt CHarvesterVideoPlugin::AddFileToBlackList( const TFileName& aFullName, const TUint32& aMediaId )