summaryrefslogtreecommitdiff
path: root/src/lib/audio_decoder_stream.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-07-08 21:13:06 +0100
committerCarl Hetherington <cth@carlh.net>2016-07-08 21:13:06 +0100
commit02cc8c7680381c123a31c23a43f6b34a04c2115a (patch)
tree5891c4c0954a05eaa538feb704cbc99e2ab1d05d /src/lib/audio_decoder_stream.cc
parent167cfacc7fe88f69fa433c46b62a54703ed6dca3 (diff)
Fix failure to analyse audio in some cases.
This fixes audio-only content when the first-emitted audio is not at time zero. This used to cause a seek which is not possible with audio-only. This commit removes the unnecessary seek which was due to missing silent-padding of the first-emitted audio.
Diffstat (limited to 'src/lib/audio_decoder_stream.cc')
-rw-r--r--src/lib/audio_decoder_stream.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/audio_decoder_stream.cc b/src/lib/audio_decoder_stream.cc
index bdcef598d..150e7c242 100644
--- a/src/lib/audio_decoder_stream.cc
+++ b/src/lib/audio_decoder_stream.cc
@@ -45,6 +45,10 @@ AudioDecoderStream::AudioDecoderStream (shared_ptr<const AudioContent> content,
, _stream (stream)
, _decoder (decoder)
, _log (log)
+ /* We effectively start having done a seek to zero; this allows silence-padding of the first
+ data that comes out of our decoder.
+ */
+ , _seek_reference (ContentTime ())
{
if (content->resampled_frame_rate() != _stream->frame_rate() && _stream->channels() > 0) {
_resampler.reset (new Resampler (_stream->frame_rate(), content->resampled_frame_rate(), _stream->channels ()));