summaryrefslogtreecommitdiff
path: root/src/lib/audio_decoder.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-05-21 19:48:14 +0100
committerCarl Hetherington <cth@carlh.net>2017-05-21 19:48:14 +0100
commitfa4d2529d63bcfa7cf7c516b7227e20a1b6dec7e (patch)
tree1ac1107370c7384fbce6cc67ee3e3aa6475f807e /src/lib/audio_decoder.h
parent5bcbd6821a6ff1419f9069cf9e1a94c8557a992c (diff)
Do resampling in AudioDecoder rather than Player.
This fixes the problem where the decoder's position would not take into account that all samples pushed into the resampler do not always immediately come out. This would result in Player thinking that there would be gaps when there are not.
Diffstat (limited to 'src/lib/audio_decoder.h')
-rw-r--r--src/lib/audio_decoder.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/audio_decoder.h b/src/lib/audio_decoder.h
index c104d8201..fcbd8267b 100644
--- a/src/lib/audio_decoder.h
+++ b/src/lib/audio_decoder.h
@@ -36,6 +36,7 @@ class AudioBuffers;
class AudioContent;
class AudioDecoderStream;
class Log;
+class Resampler;
/** @class AudioDecoder.
* @brief Parent class for audio decoders.
@@ -48,12 +49,15 @@ public:
ContentTime position () const;
void emit (AudioStreamPtr stream, boost::shared_ptr<const AudioBuffers>, ContentTime);
void seek ();
+ void flush ();
boost::signals2::signal<void (AudioStreamPtr, ContentAudio)> Data;
private:
+ boost::shared_ptr<const AudioContent> _content;
/** Frame after the last one that was emitted from Data for each AudioStream */
std::map<AudioStreamPtr, Frame> _positions;
+ std::map<AudioStreamPtr, boost::shared_ptr<Resampler> > _resamplers;
};
#endif