From 454478fa52d97a5590a05ae0222d582a3ec2f1dc Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 18 Nov 2012 21:03:32 +0000 Subject: Call processor process_end methods as required. Remove questionable padding of audio length up to the nearest second. Don't emit audio in big blocks as it seems to crash FFmpeg. Fix a few things. --- src/lib/external_audio_decoder.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/lib/external_audio_decoder.cc') diff --git a/src/lib/external_audio_decoder.cc b/src/lib/external_audio_decoder.cc index 29668d922..136e00fb2 100644 --- a/src/lib/external_audio_decoder.cc +++ b/src/lib/external_audio_decoder.cc @@ -106,9 +106,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 +122,7 @@ ExternalAudioDecoder::pass () } } + audio->set_frames (this_time); Audio (audio); frames -= this_time; } -- cgit v1.2.3