Author Topic: BASS for iOS failing to play specific MP4 file/stream  (Read 302 times)

ben.lacey

  • Posts: 4
Hi,

As part of certificating our app with Amazon, they have a long duration test stream that BASS for iOS v2.4.14.0 fails to play:

https://s3.amazonaws.com/edgecase-sandbox/3hour15min.mp4

When this is loaded via BASS_StreamCreateURL, the call fails and calling BASS_ErrorGetCode returns BASS_ERROR_FILEFORM.  However a similar but shorter mp4 stream url in the same test set works correctly: https://s3.amazonaws.com/edgecase-sandbox/1hour.mp4

I can't see anything obvious in the two file's metadata that could explain this - do you have any thoughts on what might be causing the issue?

Thanks,
Ben.

Ian @ un4seen

  • Administrator
  • Posts: 22253
The issue there is that BASS limits the amount of data that it will download to initialize an internet stream (to avoid long delays on possibly unplayable files), and that limit is insufficient for this particular MP4 file. There is a BASS_CONFIG_NET_SEEK option to change the limit (it sets the maximum seek distance) but there is currently also a hardcoded limit of 1MB applied to CoreAudio codecs (used to play MP4 on iOS). Here's an update that removes the hardcoded 1MB limit and automatically raises the limit (if necessary) to the end of an MP4 file's "moov" atom:

   www.un4seen.com/stuff/libbass.a

Let me know if it still gives you any trouble.

ben.lacey

  • Posts: 4
That's brilliant, thanks Ian - problem sorted and that ridiculously long track now plays fine :)