harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp
branchRCL_3
changeset 50 85f623e1ef41
parent 49 f23c07ec56e2
child 53 29d87345eaeb
--- a/harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp	Tue Aug 31 15:37:30 2010 +0300
+++ b/harvester/harvesterplugins/VideoPlugin/src/harvestervideoplugin.cpp	Wed Sep 01 12:24:24 2010 +0100
@@ -339,7 +339,7 @@
     if ( error != KErrNone )
         {
         WRITELOG1( "CHarvesterVideoPlugin::GetObjectType - File open error: %d", error );
-        if( error == KErrInUse || KErrLocked )
+        if( error == KErrInUse )
             {
 #ifdef _DEBUG
             TPtrC fileName( aUri.Mid(2) );
@@ -627,7 +627,6 @@
         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 )
@@ -982,7 +981,7 @@
             }
 #endif
         }
-    WRITELOG( "CHarvesterVideoPlugin - Closing file, if still open" );        
+    WRITELOG( "CHarvesterVideoPlugin - Closing file" );        
     CleanupStack::PopAndDestroy( &file );        
 
 #ifdef _DEBUG
@@ -1248,7 +1247,6 @@
     CleanupStack::PushL( helixMetadata );
     
 	TRAPD( err, helixMetadata->OpenFileL( aFile ) );
-	aFile.Close();
 
 	if( err == KErrNone )
 		{
@@ -1275,10 +1273,10 @@
 	
 		const TInt mimeCount = mimes.Count();
 		
-		// Set to Video, regardless how badly file is corrupted
+		// at least one MIME type must be found
 		if( mimeCount == 0 )
 			{
-		    aType.Copy( KVideo );
+			User::Leave( KErrNotFound );
 			}
 	
 		for( TInt i = 0; i < mimeCount; i++ )
@@ -1338,7 +1336,8 @@
     if( blackListError == KErrNone )
         {
         RemoveFileFromBlackList( tempName, mediaId );
-        }  
+        }
+    
 	}
 
 TInt CHarvesterVideoPlugin::AddFileToBlackList( const TFileName& aFullName, const TUint32& aMediaId )