I am writing an application which using fake GPS data to simulate movement of a helicopter on an area. The application needs to sync that gps data with a video. In other word, the application needs to update the video to the frames which describe the location of the helicopter. I use windows media player as the main player for my application. However, whenever i assign the currentPosition property to the new value, the property didn't update it comes back to the old value instead (i have debugged the code line by line, currentPosition didn't get assigned correctly after the assign statement). it is really frustrating me. Below is my pseudo code. I don't know why it acts like that, any help would be appreciated.
void StartFakeGPS(string filename)
{
While(true)
{
Coordinate currentLocation = GetCurrentLocation();
double second = MappingLocationToTheRightVideoSecond(currentLocation);
videoViewer.Ctlcontrols.currentPosition = second;
videoViewer.Ctlcontrols.step(1); //jump to the next frame. This force the player to update frame.
videoViwer.Refresh();
}
}