*/
+#include <iostream>
#include <sndfile.h>
#include "external_audio_decoder.h"
#include "film.h"
using boost::shared_ptr;
using boost::optional;
-ExternalAudioDecoder::ExternalAudioDecoder (shared_ptr<Film> f, shared_ptr<const Options> o, Job* j)
+ExternalAudioDecoder::ExternalAudioDecoder (shared_ptr<Film> f, DecodeOptions o, Job* j)
: Decoder (f, o, j)
, AudioDecoder (f, o, j)
{
return true;
}
- sf_count_t const block = 65536;
-
- cout << frames << " audio frames.\n";
+ /* 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 block = _audio_stream->sample_rate() / 2;
shared_ptr<AudioBuffers> audio (new AudioBuffers (_audio_stream->channels(), block));
while (frames > 0) {
}
}
+ audio->set_frames (this_time);
Audio (audio);
frames -= this_time;
}