summaryrefslogtreecommitdiff
path: root/src/lib/external_audio_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-11-18 21:03:32 +0000
committerCarl Hetherington <cth@carlh.net>2012-11-18 21:03:32 +0000
commit454478fa52d97a5590a05ae0222d582a3ec2f1dc (patch)
treee8ba6a21f53fd2b455dbd0a634524fdd31b49994 /src/lib/external_audio_decoder.cc
parentcafa76a2b52449ce3c9eecfd0ea53b7318814951 (diff)
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.
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;
}