On Jul 9, 2:42 pm, Tim De Baets <TimDeBa...@discussions.microsoft.com> wrote:
> So the only way to add real third-party metadata support is to trick WMP > into thinking that it's handling a default format instead (such as mp3). I > was eventually able to do this, by hooking into WMP and intercepting the call > that compares the audio/x-other and audio/mp3 mime types. After that, WMP > would use a metadata editor object (IWMMetadataEditor) to get the metadata of > the third-party format, just like it does for mp3. Of course, this failed for > the third-party format, so I had to hook into this too, allowing me to return > any metadata I want, including tags that are read-only in the library such as > Duration. This seemed to fix the zero-duration bug and seeking worked > perfectly. WMP indeed only uses the Duration tag in the library and ignores > the duration returned by the DirectShow filter, when a file is played from > the library.
Which call compares the mime types? I haven't been able to find it. This seems promising as a temporary solution, and it doesn't seem like there is any other way to do it.
AJD wrote: > Which call compares the mime types? I haven't been able to find it. > This seems promising as a temporary solution, and it doesn't seem like > there is any other way to do it.
WMP calls _wcsicmp from msvcrt.dll to compare the strings. Are you interested in writing a third-party metadata plug-in too? It's probably unnecessary to start from scratch; Cristian Adam is already showing interest to make such a plug-in. It will likely have pluggable tag support (just like WMP Tag Support Extender), allowing you to write a tag support dll for whatever third-party format you like.
On Jul 14, 9:37 am, Tim De Baets <tdeba...@nospam.com> wrote:
> WMP calls _wcsicmp from msvcrt.dll to compare the strings. Are you > interested in writing a third-party metadata plug-in too? It's probably > unnecessary to start from scratch; Cristian Adam is already showing > interest to make such a plug-in. It will likely have pluggable tag > support (just like WMP Tag Support Extender), allowing you to write a > tag support dll for whatever third-party format you like.
Which call is the one calling _wcsicmp?
I am interested in writing a plug-in, but not in taking the same approach that Christian has. It would make much more sense to link WMP's metadata/property handlers to the shell handlers so that were one to write metadata support for the shell then WMP would also have that support.
_wcsicmp gets called directly by wmp.dll, from within its internal MLSDBHelper::FindMediaInStoreByURL procedure (according to the symbols). If you view wmp.dll's imports, you will see that _wcsicmp is one of them.
> I am interested in writing a plug-in, but not in taking the same > approach that Christian has. It would make much more sense to link > WMP's metadata/property handlers to the shell handlers so that were > one to write metadata support for the shell then WMP would also have > that support.
That's actually an interesting idea, but property handlers are not available on XP. Also, the only property handler I have found so far that could be useful is the one for m4a files. As far as I know, no property handlers for other audio formats exist.
On Jul 14, 5:58 pm, Tim De Baets <tdeba...@nospam.com> wrote:
> AJD wrote:
> > Which call is the one calling _wcsicmp?
> _wcsicmp gets called directly by wmp.dll, from within its internal > MLSDBHelper::FindMediaInStoreByURL procedure (according to the symbols). > If you view wmp.dll's imports, you will see that _wcsicmp is one of them.
I've been looking through MLSDBHelper::FindMediaInStoreByURL for a while and have been unable to find the function responsible for creating the object which implements IWMMetadataEditor. Though the mime check is there the object seems to be created somewhere else entirely.
Which functions did you hook? I'm currently using WMP12, so this may have changed from 11.
> That's actually an interesting idea, but property handlers are not > available on XP. Also, the only property handler I have found so far > that could be useful is the one for m4a files. As far as I know, no > property handlers for other audio formats exist.
Property handlers aren't particularly difficult to write, and I currently have a FLAC property handler half-implemented (as I mentioned in a previous post I had used this to check whether WMP accessed them for duration info--it does not). I just don't see the point in duplicating code for a 3rd party plug-in when I can get WMP / and/ shell support from the same extension. I do not plan on targeting XP, only Vista and up.
AJD wrote: > I've been looking through MLSDBHelper::FindMediaInStoreByURL for a > while and have been unable to find the function responsible for > creating the object which implements IWMMetadataEditor. Though the > mime check is there the object seems to be created somewhere else > entirely.
WMP calls WMCreateEditor to retrieve a reference to a metadata editor object, I haven't checked where it does that though (that's not important anyway).
> Which functions did you hook? I'm currently using WMP12, so this may > have changed from 11.
_wcsicmp and WMCreateEditor. I haven't tested anything on WMP 12 yet.