Hi all, I'm working on an xform plugin to add playback support for some additional file formats, and I'm wondering what the best way is to handle filetype detection.
The plugin is for my own "libgamemusic" library, which already has quite extensive format detection code. I don't want to duplicate this in the form of 'magic' signatures, as some of the formats are quite involved, so I'd like to reuse the existing filetype detection code. I thought I might be able to get around this by making my plugin handle the "application/octet-stream" type, which would mean it will get a chance to examine every single file, and report back whether it can handle it or not. I figure if I set the priority to 40, then the magic plugin will run first at priority 50, and any files it does not recognise will then be handed over to my lower priority plugin to examine. Unfortunately it looks like the XMMS2 priority system doesn't work like this, and if the highest priority plugin reports that it cannot handle the file, no other plugins are tried. This for example, is the output at the moment: 09:29:00 DEBUG in core: ../src/xmms/xform.c:1131: Plugin 'magic' matched (priority 50) 09:29:00 DEBUG in core: ../src/xmms/xform.c:1131: Plugin 'libgamemusic' matched (priority 40) 09:29:00 DEBUG in core: ../src/xmms/magic.c:469: Magic didn't match anything... 09:29:00 DEBUG in core: ../src/xmms/xform.c:316: Freeing xform 'magic' 09:29:00 ERROR in core: ../src/xmms/xform.c:1311: Couldn't set up chain for 'file://...' (48295) Here you can see that when the 'magic' plugin cannot handle the file format, XMMS2 gives up without trying any other lower priority plugins. Is it possible for this behaviour to be changed, so that all plugins that handle a given format are tried until a chain is successfully set up, instead of only the highest priority one? Many thanks, Adam. -- _______________________________________________ Xmms2-devel mailing list Xmms2-devel@lists.xmms2.org https://lists.xmms2.org/cgi-bin/mailman/listinfo/xmms2-devel