ap4y / OrigamiEngine

Lightweight audio engine for iOS and OSX with flac, cue, mp3, m4a, m3u support.
http://ap4y.github.com/OrigamiEngine/
MIT License
545 stars 118 forks source link

Can not find `decoder` for some URLs #36

Closed daria-kopaliani closed 10 years ago

daria-kopaliani commented 10 years ago

For instance if source url looks like this "http://someurl?someparameters&1234.m4a",

NSString *extension = [[[source url] path] pathExtension];

extension will be nil and therefore decoder will also be nil. Using absoluteString instead of path will solve this issue.

ap4y commented 10 years ago

I'm not sure if absoluteString is a good idea. According to rfc this url doesn't have an extension, so this behaviour is kind of expected. I think that parsing parameters as fallback can be considered.

tyrone-sudeium commented 10 years ago

I was hoping there was some way to manually specify which decoder you want rather than assuming it can always be derived from the URL. I'm working with a webservice right now that provides files with a URL like /track/:id/:format i.e

http://my.site/track/1337/opus

I might pull request a proper fix later on if I can find the time and if there's any demand for such functionality. In my project at the moment I'm just monkeypatching in a custom ORGMSource which tells the rest of the OrigamiEngine system that the URL has a certain path extension, but then proceeds to open a NSURLRequest without the extension...

ap4y commented 10 years ago

Hi Tyrone, thanks for the suggestion. I actually like this idea with customisations for the plugin resolution process. What I'm thinking is instead of using ORGMPluginManager singleton for the plugin resolution, I can allow users to provide custom plugin manager(or resolver) that will return classes according to user's expectations. Let me see what I can do.