Menu

Random Deadlock issue

BEZ
2009-08-30
2012-10-29
  • BEZ

    BEZ - 2009-08-30

    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.

     
    • snarfle

      snarfle - 2009-08-30

      Are you calling Run from your main message thread?

       
      • BEZ

        BEZ - 2009-08-30

        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.

         
        • snarfle

          snarfle - 2009-08-30

          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.

           
          • BEZ

            BEZ - 2009-08-30

            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

             
            • snarfle

              snarfle - 2009-08-30

              Seems unlikely.

               

Log in to post a comment.