harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp
branchRCL_3
changeset 20 f23c07ec56e2
parent 19 b73252188534
child 21 85f623e1ef41
--- a/harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp	Thu Aug 19 10:20:41 2010 +0300
+++ b/harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp	Tue Aug 31 15:37:30 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 )