Opened 9 years ago

Last modified 6 years ago

#10958 reopened defect

wxEVT_MEDIA_LOADED doesn't work in Windows Vista

Reported by: forrestcupp Owned by:
Priority: normal Milestone:
Component: wxMSW Version: 2.8.9
Keywords: wxEVT_MEDIA_LOADED wxMediaCtrl Vista Cc:
Blocked By: Blocking:
Patch: no


I'm using the exact code that works for others to catch the event when a wxMediaCtrl is loaded so that I can immediately play it when it's loaded.

It will not work in Windows Vista. For some reason, it won't set off that event when an audio file is finished loading. I've heard reports from someone else that the same compiled program that does this works in XP but when it's run in Vista, it doesn't work.

It's also my experience that it doesn't work in Vista. This is something that really needs to work to make it more usable.

Change History (5)

comment:1 Changed 9 years ago by vadz

  • Resolution set to duplicate
  • Status changed from new to closed

Same as #10957.

comment:2 Changed 9 years ago by vadz

  • Resolution duplicate deleted
  • Status changed from closed to reopened

Sorry, I was too hasty and didn't notice that the event was different from the other one.

For both bugs: what wxMediaCtrl backend do you use? Can the bugs be reproduced in the sample? With what files?

comment:3 Changed 9 years ago by forrestcupp

I will comment on the Finished event in the other ticket.

I am letting wxMediaCtrl choose the backend, so I assume it is wxMEDIABACKEND_DIRECTSHOW. According to the OpenAl web site, Microsoft removed hardware accelerated DirectSound from Vista, so I don't know if that is a problem or not.

I compiled the mediaplayer sample to try to reproduce the bug. I didn't look at the code closely enough to see what it is supposed to do, but in Vista, it does not automatically play when a file is loaded, or when I go to the next or previous file. If it is supposed to do that, then this is confirmation of the bug.

According to stobesel in the thread below at the forums, he said that the Load appears to be firing an EVT_MEDIA_STOP. If it's not supposed to do that, maybe that's something to look into.

In the option while running the sample program, I tried changing the backend to wxMEDIABACKEND_MCI because I saw that it is a Windows backend. When I did that, the sample program crashed with an error saying the wxMediaCtrl could not be created.

comment:4 Changed 8 years ago by ngpaton


I've just seen this problem myself and in my case it looks like the the Ready State Change handling is not correct in mediactrl_am.cpp wxAMMediaEvtHandler::OnActiveX(). I've already replied to the forum topic ( on this where I suggest a change although I have done very little testing on this.

I saw the problem when using a WAV file on Win7 (media control using IMediaPlayer, ready state change event param order is 1, 0, 4, 1, 4). The problem does not occur on WinXP (ready state change event param order 0, 1, 3, 4). My change works in both cases as it requires a 0 to 1 transition followed by a transition to 3 or 4. This is needed to ignore the spurious complete state you get right after the uninitialised state.

I've not tested streaming or any other file types.



comment:5 Changed 6 years ago by vadz

According to #13828 this indeed happens only with DirectShow backend. I still have no idea about what exactly is the bug and how to fix it. Any help with this would be appreciated as I have no knowledge of DirectShow.

Note: See TracTickets for help on using tickets.