X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fexternal_audio_decoder.cc;h=36605141886aed7ec596bb024b0425bfedc23f94;hb=4870ce43dd314d557f7b14938456138c746fd617;hp=29668d922836fc5ceea9100d28e041690a4a7cd4;hpb=cafa76a2b52449ce3c9eecfd0ea53b7318814951;p=dcpomatic.git diff --git a/src/lib/external_audio_decoder.cc b/src/lib/external_audio_decoder.cc index 29668d922..366051418 100644 --- a/src/lib/external_audio_decoder.cc +++ b/src/lib/external_audio_decoder.cc @@ -17,6 +17,7 @@ */ +#include #include #include "external_audio_decoder.h" #include "film.h" @@ -30,7 +31,7 @@ using std::cout; using boost::shared_ptr; using boost::optional; -ExternalAudioDecoder::ExternalAudioDecoder (shared_ptr f, shared_ptr o, Job* j) +ExternalAudioDecoder::ExternalAudioDecoder (shared_ptr f, DecodeOptions o, Job* j) : Decoder (f, o, j) , AudioDecoder (f, o, j) { @@ -106,9 +107,10 @@ ExternalAudioDecoder::pass () 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 audio (new AudioBuffers (_audio_stream->channels(), block)); while (frames > 0) { @@ -121,6 +123,7 @@ ExternalAudioDecoder::pass () } } + audio->set_frames (this_time); Audio (audio); frames -= this_time; }