Add "seekable" SoundFile info (in prep for mp3 import)

This commit is contained in:
Robin Gareus 2019-12-06 18:08:38 +01:00
parent 227de8c1b0
commit bef74c267e
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
3 changed files with 3 additions and 0 deletions

View file

@ -36,6 +36,7 @@ struct LIBARDOUR_API SoundFileInfo {
int64_t length;
std::string format_name;
int64_t timecode;
bool seekable; // non-seekable files must be converted/imported
};
class LIBARDOUR_API AudioFileSource : public AudioSource, public FileSource {

View file

@ -282,6 +282,7 @@ CoreAudioSource::get_soundfile_info (string path, SoundFileInfo& _info, string&)
_info.samplerate = absd.mSampleRate;
_info.channels = absd.mChannelsPerFrame;
_info.seekable = true;
size = sizeof(_info.length);
if (ExtAudioFileGetProperty(af, kExtAudioFileProperty_FileLengthFrames, &size, &_info.length) != noErr) {

View file

@ -1117,6 +1117,7 @@ SndFileSource::get_soundfile_info (const string& path, SoundFileInfo& info, stri
}
info.timecode = binfo.load_from_file (sf) ? binfo.get_time_reference() : 0;
info.seekable = true;
sf_close (sf);