I've also noticed that the total runtime getDuration() can be wrong (which isn't a big issue) and I've tested that getCurrentPosition() is accurate enough (as in every n seconds of playback, it increases by n thousand). I'm on Android 2.2.
Seek to Key frame - The video when encoded will usually have something called as the I frame or the Key frame, it means that this frame has lot of information and can be used to decode a frame in its entirety. To reduce the amount of space all the frames are not encoded as key frames instead they are encoded as P (Predicted) frames or predicted frames, meaning you can decode a P frame with the help from the key frame.
So during the seek operation, in this case the seeking is done to the closest key frame for a given time duration. For example if the user seeks to 40secs and the closest key frame is at 35th sec then seeking is done to the 35th sec and not to the 40th second.
The seeking is still done at the closest key frame since otherwise you will see green patches or pixelation of the video which is highly undesirable. So instead the seeking is done to the key frame and then frames are decoded until the required time but these frames are dropped and are not shown to the user. In above example, all the decoded frames from the 35th to 40th second are discarded and only the frames beyond 40th sec are shown to the user.
VBR - Variable Bit rate - The bit rate is not constant it keeps varying. So in this case the find out the average bitrate of the file and then use the above method, in this case seeking will not be accurate.
The only reason why you could be facing such issues is becuase the media file is itself corrupted. (It is just not possible to have a difference of 30seconds during seek + you are saying the duration is not returned correctly. And none of the mediaplayer API's are broken for Android 2.2)
i dont know anything about android. But i know that in most of media file format there is a one provision that called seek entries or cues entry..that shows for this particular time from here video & audio should be start to play
c80f0f1006