mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioControllerUtility/Src/MP3AudioControllerUtility.cpp
branchRCL_3
changeset 17 3570217d8c21
parent 0 71ca22bcf22a
--- a/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioControllerUtility/Src/MP3AudioControllerUtility.cpp	Tue Apr 27 17:11:02 2010 +0300
+++ b/mmfenh/advancedaudiocontroller/audiocontrollerpluginsvariant/AdvancedAudioControllerUtility/Src/MP3AudioControllerUtility.cpp	Tue May 11 16:42:02 2010 +0300
@@ -175,6 +175,8 @@
 	TInt frameBytes = 0;
 	TInt avgFrameLen = 0;
 	TInt frames = 0;
+	TInt scaling=0;
+	TInt round=0;
 	// We could have used the bitrate found above for CBR MP3 content and not continue to average
 	// the bitrate. However, some users can manipulated the file and append other bitrate content.
 	// Since it is not too difficult, we can update the bitrate above with an averaged bitrate.
@@ -203,6 +205,12 @@
 			frames++;    	        	
 			}	
 		avgFrameLen = frameBytes / frames; // frames is always non-zero here
+		scaling = frameBytes*10/frames;
+		round = scaling%10;
+		if(round > 5)
+		    {
+		     ++avgFrameLen;
+		    }
 		}
 	iBitRate = (avgFrameLen * 8 * iSamplingRate) / iSamplesPerFrame;
 	}