using std::cout;
using boost::shared_ptr;
-SndfileDecoder::SndfileDecoder (shared_ptr<const SndfileContent> c)
+SndfileDecoder::SndfileDecoder (shared_ptr<const SndfileContent> c, bool fast)
: Sndfile (c)
- , AudioDecoder (c)
+ , AudioDecoder (c, fast)
, _done (0)
, _remaining (_info.frames)
, _deinterleave_buffer (0)
{
-
+
}
SndfileDecoder::~SndfileDecoder ()
}
bool
-SndfileDecoder::pass ()
+SndfileDecoder::pass (PassReason, bool)
{
if (_remaining == 0) {
return true;
}
-
+
/* Do things in half second blocks as I think there may be limits
to what FFmpeg (and in particular the resampler) can cope with.
*/
sf_count_t const this_time = min (block, _remaining);
int const channels = _sndfile_content->audio_stream()->channels ();
-
+
shared_ptr<AudioBuffers> data (new AudioBuffers (channels, this_time));
if (_sndfile_content->audio_stream()->channels() == 1) {
}
}
}
-
+
data->set_frames (this_time);
audio (_sndfile_content->audio_stream (), data, ContentTime::from_frames (_done, _info.samplerate));
_done += this_time;
{
AudioDecoder::seek (t, accurate);
- _done = t.frames (_info.samplerate);
+ _done = t.frames_round (_info.samplerate);
_remaining = _info.frames - _done;
}