summaryrefslogtreecommitdiff
path: root/src/lib/sndfile_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-04-21 22:41:52 +0100
committerCarl Hetherington <cth@carlh.net>2013-04-21 22:41:52 +0100
commit47f25009bcbc765e397bcb471dd361a511c99daf (patch)
tree356ac924524183047a84e34674985b3a00c5ca24 /src/lib/sndfile_decoder.cc
parentafc495f722f89fea0bcc579046d1a5d362e36f69 (diff)
parente8d8a27c7f6861b031b3250b0ad50d04c41a7721 (diff)
Untested merge of master.
Diffstat (limited to 'src/lib/sndfile_decoder.cc')
-rw-r--r--src/lib/sndfile_decoder.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/sndfile_decoder.cc b/src/lib/sndfile_decoder.cc
index c7311112a..4db45f1d4 100644
--- a/src/lib/sndfile_decoder.cc
+++ b/src/lib/sndfile_decoder.cc
@@ -42,6 +42,7 @@ SndfileDecoder::SndfileDecoder (shared_ptr<const Film> f, shared_ptr<const Sndfi
throw DecodeError (_("could not open audio file for reading"));
}
+ _done = 0;
_remaining = _info.frames;
}
@@ -64,7 +65,8 @@ SndfileDecoder::pass ()
shared_ptr<AudioBuffers> audio (new AudioBuffers (_sndfile_content->audio_channels(), this_time));
sf_read_float (_sndfile, audio->data(0), this_time);
audio->set_frames (this_time);
- Audio (audio);
+ Audio (audio, double(_done) / audio_frame_rate());
+ _done += this_time;
_remaining -= this_time;
return (_remaining == 0);