rse
18th October 2008, 00:27
Hi!
Iīm currently writing on my own mediaplayer. For playback Iīm totally relying on DirectShow. It provides a possibility to change playback rate, which uses the IMediaSeeking::SetRate function of DirectShow. The Problem is as follows:
When IMediaSeeking::SetRate is set to a higher playback speed, then the media plays faster as expected. Iīm polling IMediaSeeking::GetCurrentPosition for measuring the playback rate and setting the progress bar. But when the progress bar is at the end, the music is still playing! The faster the speed and the longer the time, the bigger is the difference between real end of the file and the time when the position from IMediaSeeking::GetCurrentPosition reaches the end position. After reaching the end position IMediaSeeking::GetCurrentPosition always returns the end position. The EC_COMPLETE-Message is sent at the real end of the file. So the only problem is the wrong position reported, and this is only wrong when speed is modified (slower or faster).
Is DirectShow really this buggy, and what could be a workaround for that? The only way I could think of, is to build my own filter, put it into the codec chain manually and count the audio frames passed. This and the framerate gives me the time. Is this the only way?
thanks for your help
RSE
Iīm currently writing on my own mediaplayer. For playback Iīm totally relying on DirectShow. It provides a possibility to change playback rate, which uses the IMediaSeeking::SetRate function of DirectShow. The Problem is as follows:
When IMediaSeeking::SetRate is set to a higher playback speed, then the media plays faster as expected. Iīm polling IMediaSeeking::GetCurrentPosition for measuring the playback rate and setting the progress bar. But when the progress bar is at the end, the music is still playing! The faster the speed and the longer the time, the bigger is the difference between real end of the file and the time when the position from IMediaSeeking::GetCurrentPosition reaches the end position. After reaching the end position IMediaSeeking::GetCurrentPosition always returns the end position. The EC_COMPLETE-Message is sent at the real end of the file. So the only problem is the wrong position reported, and this is only wrong when speed is modified (slower or faster).
Is DirectShow really this buggy, and what could be a workaround for that? The only way I could think of, is to build my own filter, put it into the codec chain manually and count the audio frames passed. This and the framerate gives me the time. Is this the only way?
thanks for your help
RSE