#67 Refactor dynamic loading, fix MP3 issues

closed-accepted
nobody
None
5
2009-11-28
2009-09-15
Doug Cook
No

Create an abstraction of dynamic loading so that the format handler doesn't need to know whether LTDL is present or not (except perhaps for the purpose of disabling dynamic loading if it is missing), and so that most of the format handler's code is the same whether using dynamic or static linking. This also adds the capability to look for multiple dynamic libraries with different names (i.e. successfully load any of libsndfile-1, libsndfile, sndfile, cygsndfile, whichever one can be found). Also adds the ability to use stubs for optional functionality that might be missing from some DLLs, such as the export for sf_stop, so that sf_stop will be used if present but the DLL will load even if sf_stop is not present.

Demonstrate the use of this abstraction by making libsndfile loadable via dlopen. Also applies easily to the mp3 handler, though there are already too many patches pending on that for me to easily include it, and dlopen is already working for it, so not a high priority.

Note that libsndfile can only be opened if the sf_open_virtual function is available, since file descriptors cannot be safely passed from one DLL to another. It will work if they share the same CRT, but if they don't, it will fail with unpredictable results.

Discussion

  • Doug Cook

    Doug Cook - 2009-09-17

    Updated to include making mp3 use the same mechanism. This also includes various fixes for mp3.

     
  • Doug Cook

    Doug Cook - 2009-09-19

    Updated patch. Now uses macro magic so that the function table only needs to be specified in one place, with the added benefit of avoiding warnings.

     
  • Doug Cook

    Doug Cook - 2009-09-27

    Refined DLL interface, integrate several MP3 fixes

     
  • Doug Cook

    Doug Cook - 2009-09-27

    Updated patch. Includes Jim's VBR and ID3 tag fixes and fixes the TLEN problem. Also pulls out the buffer allocation so that instead of allocating and freeing buffers for each read/write, it allocates the buffers in start and frees them in finish.

     
  • Doug Cook

    Doug Cook - 2009-09-27
    • summary: Enable dynamically loading libsndfile --> Refactor dynamic loading, fix MP3 issues
     
  • Chris Bagwell

    Chris Bagwell - 2009-11-28

    I believe that this patch was totally committed by Rob. Plesae re-open new tracker if there are additional outstanding dlopen related patches. Thanks!

     
  • Chris Bagwell

    Chris Bagwell - 2009-11-28
    • status: open --> closed
     
  • Chris Bagwell

    Chris Bagwell - 2009-11-28
    • status: closed --> closed-accepted
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks