fix problem with SrcFileSource

::length() was non-virtual, and so calling SrcFileSource::length() would access
the base class (AudioFileSource)'s version. Since SrcFileSource is essentially
a pimpl-like pattern, this was incorrect; we need to make sure we call the
pimpl-style method instead.
This commit is contained in:
Paul Davis 2021-10-14 13:10:46 -06:00
parent 2066b6b33a
commit 27572a2bce
2 changed files with 2 additions and 2 deletions

View file

@ -74,7 +74,7 @@ public:
time_t timestamp() const { return _timestamp; }
void stamp (time_t when) { _timestamp = when; }
timecnt_t length() const { return _length; }
virtual timecnt_t length() const { return _length; }
samplecnt_t length_samples () const { return _length.samples(); };
virtual bool empty () const;

View file

@ -44,7 +44,7 @@ public:
timepos_t natural_position() const { return _source->natural_position() * _ratio;}
samplecnt_t readable_length_samples() const { return _source->length_samples () * _ratio; }
samplecnt_t length (samplepos_t /*pos*/) const { return _source->length_samples () * _ratio; }
timecnt_t length () const { return timecnt_t ((samplecnt_t) (_source->length_samples () * _ratio)); }
bool can_be_analysed() const { return false; }
bool clamped_at_unity() const { return false; }