AudioDecoder * AudioDecoder::CreateDecoderForURLRegion(CFURLRef url, SInt64 startingFrame, CFErrorRef *error) { if(nullptr == url) return nullptr; InputSource *inputSource = InputSource::CreateInputSourceForURL(url, 0, error); if(nullptr == inputSource) return nullptr; AudioDecoder *decoder = CreateDecoderForInputSourceRegion(inputSource, startingFrame, error); if(nullptr == decoder) delete inputSource, inputSource = nullptr; return decoder; }
AudioDecoder * AudioDecoder::CreateDecoderForURLRegion(CFURLRef url, SInt64 startingFrame, UInt32 frameCount, UInt32 repeatCount, CFErrorRef *error) { if(NULL == url) return NULL; InputSource *inputSource = InputSource::CreateInputSourceForURL(url, 0, error); if(NULL == inputSource) return NULL; AudioDecoder *decoder = CreateDecoderForInputSourceRegion(inputSource, startingFrame, frameCount, repeatCount, error); if(NULL == decoder) delete inputSource, inputSource = NULL; return decoder; }
SFB::Audio::Decoder::unique_ptr SFB::Audio::Decoder::CreateDecoderForURLRegion(CFURLRef url, SInt64 startingFrame, UInt32 frameCount, UInt32 repeatCount, CFErrorRef *error) { return CreateDecoderForInputSourceRegion(InputSource::CreateInputSourceForURL(url, 0, error), startingFrame, frameCount, repeatCount, error); }