Checklist
Current bug behaviour
When player has been disposed after playing a file, the input is still open.
Expected behaviour
File closed to not leak resources and be able to manipulate it.
Steps to reproduce
- play an input file.
- dispose the player.
Code sample
No response
Affected platforms
Windows
Platform details
Windows 11
AudioPlayers Version
4.1.0
Build mode
debug, release
Audio Files/URLs/Sources
No response
Screenshots
No response
Logs
HRESULT_FROM_WIN32(ERROR_SHARING_VIOLATION) : Le processus ne peut pas accéder au fichier car ce fichier est utilisé par un autre processus.
Related issues / more information
As far as I can tell regarding the code, the source is not released.
As IMFMediaSource is COM object, Release() should be called before setting the pointer to a null reference.
Maybe I'm wrong on the issue location:
https://github.com/bluefireteam/audioplayers/blob/92995357c4e29d63537d66f478dca8f655e99a08/packages/audioplayers_windows/windows/MediaEngineExtension.cpp#LL104C9-L104C25
For what it's worth I use those wrappers to release COM objects:
//////////////////////////////////////////////////////////////////////////
// COM Safe release
//////////////////////////////////////////////////////////////////////////
template <class T> void SafeRelease(T** ppT)
{
if (*ppT)
{
(*ppT)->Release();
*ppT = NULL;
}
}
template <class T> inline void SafeRelease(T*& pT)
{
if (pT != NULL)
{
pT->Release();
pT = NULL;
}
}
Working on PR
no way
Checklist
Current bug behaviour
When player has been disposed after playing a file, the input is still open.
Expected behaviour
File closed to not leak resources and be able to manipulate it.
Steps to reproduce
Code sample
No response
Affected platforms
Windows
Platform details
Windows 11
AudioPlayers Version
4.1.0
Build mode
debug, release
Audio Files/URLs/Sources
No response
Screenshots
No response
Logs
Related issues / more information
As far as I can tell regarding the code, the source is not released.
As
IMFMediaSourceis COM object,Release()should be called before setting the pointer to a null reference.Maybe I'm wrong on the issue location:
https://github.com/bluefireteam/audioplayers/blob/92995357c4e29d63537d66f478dca8f655e99a08/packages/audioplayers_windows/windows/MediaEngineExtension.cpp#LL104C9-L104C25
For what it's worth I use those wrappers to release COM objects:
Working on PR
no way