I have an audio playback program that is using the ImediaControl interface to control the playback of the audio file. The code works fine most of the time but when I get 5 to 10 audo streams playing at the same time I get random dead locks on the following line of code
hr = Me.c_mediaControl.Run()
The call just never returns. I have a try catch around the code and I get nothing. It never times out. All of the audo streams that are running continue to run until they reach the end.
What could cause this to occure? All of the audio files in our test bed have been verified and played so none of them are bad. The callback events for the filtergraphs have been verified and are running correctly. Any ideas on how I could counteract this as the call never returns so I can not handle any errors or prevent the deadlock?
Thanks
zktech.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a player object that I creat multiple instance of and then I call the Run function on each using a timer control. The timer control is seated on my main form. So I belive that the thread for the timer control is doing the call.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I wil give this a try and post back with an update. Thanks for the ideas. Could using the timer also cause a memory leak with com? On XP there seems to be some kind of leak but it does not occur under Vista or Win 7 with the same code.
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have an audio playback program that is using the ImediaControl interface to control the playback of the audio file. The code works fine most of the time but when I get 5 to 10 audo streams playing at the same time I get random dead locks on the following line of code
hr = Me.c_mediaControl.Run()
The call just never returns. I have a try catch around the code and I get nothing. It never times out. All of the audo streams that are running continue to run until they reach the end.
What could cause this to occure? All of the audio files in our test bed have been verified and played so none of them are bad. The callback events for the filtergraphs have been verified and are running correctly. Any ideas on how I could counteract this as the call never returns so I can not handle any errors or prevent the deadlock?
Thanks
zktech.
Are you calling Run from your main message thread?
I have a player object that I creat multiple instance of and then I call the Run function on each using a timer control. The timer control is seated on my main form. So I belive that the thread for the timer control is doing the call.
COM can be odd about creating object on one thread and using them from another.
You might experiment with http://msdn.microsoft.com/en-us/library/0b1bf3y3.aspx. This can be used from the timer thread to have the Run performed on the main thread.
I wil give this a try and post back with an update. Thanks for the ideas. Could using the timer also cause a memory leak with com? On XP there seems to be some kind of leak but it does not occur under Vista or Win 7 with the same code.
Thanks
Seems unlikely.