projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into fix-early-audio-take2
[dcpomatic.git]
/
src
/
lib
/
sndfile_decoder.cc
diff --git
a/src/lib/sndfile_decoder.cc
b/src/lib/sndfile_decoder.cc
index 0e3e5e2345a9538b2267493762a88d1485ff15da..af59c049c31dba1acc59d9dad4132a2de5b8dcaa 100644
(file)
--- a/
src/lib/sndfile_decoder.cc
+++ b/
src/lib/sndfile_decoder.cc
@@
-113,8
+113,8
@@
SndfileDecoder::pass ()
to what FFmpeg (and in particular the resampler) can cope with.
*/
sf_count_t const block = _audio_stream->sample_rate() / 2;
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));
shared_ptr<AudioBuffers> audio (new AudioBuffers (_audio_stream->channels(), block));
+ sf_count_t done = 0;
while (frames > 0) {
sf_count_t const this_time = min (block, frames);
for (size_t i = 0; i < sndfiles.size(); ++i) {
while (frames > 0) {
sf_count_t const this_time = min (block, frames);
for (size_t i = 0; i < sndfiles.size(); ++i) {
@@
-126,7
+126,8
@@
SndfileDecoder::pass ()
}
audio->set_frames (this_time);
}
audio->set_frames (this_time);
- Audio (audio);
+ Audio (audio, double(done) / _audio_stream->sample_rate());
+ done += this_time;
frames -= this_time;
}
frames -= this_time;
}