summaryrefslogtreecommitdiff
path: root/src/lib/external_audio_decoder.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/external_audio_decoder.cc')
-rw-r--r--src/lib/external_audio_decoder.cc8
1 files changed, 5 insertions, 3 deletions
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<AudioBuffers> 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;
}