Old 16th August 2015, 03:32   #1
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 2,930
Send a message via Skype™ to thinktink
Thread Safe

Inside in_mp3.dll are the exported functions winampGetExtendedFileInfo(W) multi-thread safe?
thinktink is offline   Reply With Quote
Old 17th August 2015, 04:38   #2
Benski
Ben Allison
Former Winamp Developer
 
Benski's Avatar
 
Join Date: Jan 2005
Location: Brooklyn, NY
Posts: 1,047
No.

Thread safety for metadata reading is provided by winamp.exe (via Critical Section)
Benski is offline   Reply With Quote
Old 17th August 2015, 04:58   #3
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 2,930
Send a message via Skype™ to thinktink
Thank you VERY much for responding. I had my doubts as to why I was seeing certain errors.

Damn-it damn-it damn-it damn-it damn-it damn-it damn-it damn-it damn-it damn-it damn-it damn-it damn-it damn-it damn-it damn-it damn-it damn-it damn-it damn-it damn-it damn-it damn-it damn-it damn-it, this entire time...

Bah, I should know better anyways.



Is there a way I can directly access/call/use that CRITICAL_SECTION object outside of ::SendMessageW(winampHWnd,...) mechanism? I need to be able to call these functions directly for speed reasons (and to minimize thread dead-locks) for a particular chain of functions that call it repeatedly.


P.S.
Nice to see you're still around. Pop in more often.
thinktink is offline   Reply With Quote
Old 17th August 2015, 16:59   #4
Victhor
Late skinner & Moderator
 
Victhor's Avatar
 
Join Date: May 2003
Location: Argentina
Posts: 1,364
Quote:
Originally Posted by thinktink View Post
P.S.
Nice to see you're still around. Pop in more often.
I'd love to see that "former Winamp developer" loose the first word.. =D

· · TMCT · KOMODO X
Victhor is offline   Reply With Quote
Old 18th August 2015, 15:12   #5
Benski
Ben Allison
Former Winamp Developer
 
Benski's Avatar
 
Join Date: Jan 2005
Location: Brooklyn, NY
Posts: 1,047
Quote:
Originally Posted by thinktink View Post
Is there a way I can directly access/call/use that CRITICAL_SECTION object outside of ::SendMessageW(winampHWnd,...) mechanism? I need to be able to call these functions directly for speed reasons (and to minimize thread dead-locks) for a particular chain of functions that call it repeatedly.
The critical section is required because many plugins implement a cache of the most recently queried file's metadata, and do so in an unsafe way.

There is a Wasabi API called api_metadata. I think it's in the SDK somewhere. That essentially calls into the same function that the SendMessage(IPC_GET_EXTENDED_FILE_INFOW) API does, but without the SendMessage overhead. ml_local uses it for metadata reading, for example.

There's also an old Winamp3 API (and available in winamp 5 for compatibility reasons) that can be used for thread-safe metadata reading without hitting the critical section, but only in_mp3 and in_wmvdrm implement it. I can dig up details on it if you need.

For Winamp-for-Android (And the formerly in-progress Winamp 6 project), there is a much better metadata API, if only ...
Benski is offline   Reply With Quote
Old 18th August 2015, 20:49   #6
thinktink
Forum King
 
thinktink's Avatar
 
Join Date: May 2009
Location: On the streets of Kings County, CA.
Posts: 2,930
Send a message via Skype™ to thinktink
Ah excellent, I think I've seen that API somewhere. Thanks.
thinktink is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > Winamp Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump