how to stream mp3 in thread

DLL Edition of the F-IN-BOX
Posts: 1
Joined: Fri Jul 02, 2010 8:09 am

how to stream mp3 in thread

Postby ani123 » Fri Jul 02, 2010 9:13 am

I am trying out f-in-box for a project and have been successful in the following:
1. Use FPC_AddOnLoadExternalResourceHandler with CoMarshalInterThreadInterfaceInStream to stream a FLV in a separate thread
2. Use FPCN_LOADEXTERNALRESOURCE to load and play a MP3 from a stream. This however holds up the app until the entire MP3 loads. This is where my problem lies.

What I need to be able to do is stream a MP3 in a separate thread just like the FLV. This is where Ihave been unsuccessful. I have tried to use the AddOnLoadExternalResourceHandler for MP3 files but it crashes the app. I have tried the code below inside LOADEXTERNALRESOURCE to setup a thread for the stream. But this aborts with E_ABORT when writing to the stream and the MediaPlayback component behaves as if no file is loaded.
SFPCLoadExternalResource* pInfo = (SFPCLoadExternalResource*)lParam;

if (0 == lstrcmpi(pInfo->lpszRelativePath, "test.mp3"))
SFPCLoadExternalResource* pInfo = (SFPCLoadExternalResource*)lParam;
IStream* pStream = pInfo->lpStream;

IStream* pStreamForMarshalling;
CoMarshalInterThreadInterfaceInStream(IID_IStream, pStream, &pStreamForMarshalling);

DWORD dwThreadId;
HANDLE hThread = CreateThread(NULL, 0, &FlashContentProviderThread, (LPVOID)pStreamForMarshalling, 0, &dwThreadId);

Has anybody been able to stream a MP3 in a separate thread so that it doesnt block up the system till the entire file is streamed? Please advise!


Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg

Postby Softanics » Fri Jul 02, 2010 9:44 am


Could you please send me the sample code to support (at), I will check it.

Thank you.
Best regards, Artem A. Razin,
F-IN-BOX support
Ask your question here:

Return to “DLL Edition”

Who is online

Users browsing this forum: No registered users and 1 guest