summaryrefslogtreecommitdiff
path: root/src/lib/audio_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-01-02 21:09:36 +0000
committerCarl Hetherington <cth@carlh.net>2018-01-02 21:09:36 +0000
commit2537a2d959a5872c2e75b322022a7679d24c7e60 (patch)
treee0180a52fc2682676736c59c5b4f1b6dd3e6fe71 /src/lib/audio_decoder.cc
parente7adac0f25e0d2a38be56e4477ed78b8b34b8b34 (diff)
A previous commit took care to make Decoder::position() not be updated
if the data that was emitted from the decoder was not taken by the player. This means that when the decoder moves into its end trim the position will stay where it is (since the player does not take the data). I can't see the point of doing this; the only use of Decoder::position() is to decide what to pass() next (I think). It is also inconvenient because we would like to check Decoder::position() to decide whether to stop passing a decoder since it's in its end trim (not doing this causes #1154).
Diffstat (limited to 'src/lib/audio_decoder.cc')
-rw-r--r--src/lib/audio_decoder.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/audio_decoder.cc b/src/lib/audio_decoder.cc
index 5df4047db..4bd6535d8 100644
--- a/src/lib/audio_decoder.cc
+++ b/src/lib/audio_decoder.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -98,7 +98,8 @@ AudioDecoder::emit (AudioStreamPtr stream, shared_ptr<const AudioBuffers> data,
data = ro;
}
- _positions[stream] += Data(stream, ContentAudio (data, _positions[stream])).get_value_or(0);
+ Data(stream, ContentAudio (data, _positions[stream]));
+ _positions[stream] += data->frames();
}
/** @return Time just after the last thing that was emitted from a given stream */