Index: pipeline.cpp =================================================================== --- pipeline.cpp (revision 113082) +++ pipeline.cpp (working copy) @@ -22,6 +22,8 @@ #include #include +#include + #include "pipeline.h" #include "pipeline-ffmpeg.h" #include "mp3.h" @@ -38,6 +40,33 @@ #define LOG_PIPELINE_ERROR_CONDITIONAL(x, ...) if (x) printf (__VA_ARGS__); #define LOG_FRAMEREADERLOOP(...)// printf (__VA_ARGS__); +void +register_mscodecs (void) +{ + void (*reg) (void); + //void *dl = dlopen ("/opt/mono/lib/moon/libmscodecs.so", RTLD_NOW); + void *dl = dlopen ("/opt/mono/lib/moon/libmscodecs.so", RTLD_LAZY); + if (dl == NULL) + goto dl_error; + + //*(void **) (®) = dlsym (dl, "register_mswma"); + *(void **) (®) = dlsym (dl, "_Z14register_mswmav"); + if (reg == NULL) + goto dl_error; + + (*reg)(); + return; + +dl_error: + char *error_str = dlerror(); + g_print ("Cannot load libmscodecs.so: %s\n", error_str); + return; +} + + + + + class MediaNode : public List::Node { public: Media *media; @@ -241,6 +270,7 @@ // decoders Media::RegisterDecoder (new ASFMarkerDecoderInfo ()); + register_mscodecs (); #ifdef INCLUDE_FFMPEG register_ffmpeg (); #else