Use 1.0 branch of libdcp.
[dcpomatic.git] / src / lib / sndfile_decoder.cc
index 3af683c570a89b21a59cf6fd68d8a9f6d37d3fb7..d6537843e8970ebde3ae6872bb99f04fd66e5de3 100644 (file)
@@ -94,11 +94,11 @@ SndfileDecoder::pass ()
        }
                
        data->set_frames (this_time);
-       audio (data, _done);
+       audio (data, _done * TIME_HZ / audio_frame_rate ());
        _done += this_time;
        _remaining -= this_time;
 
-       return true;
+       return _remaining == 0;
 }
 
 int
@@ -107,7 +107,7 @@ SndfileDecoder::audio_channels () const
        return _info.channels;
 }
 
-AudioContent::Frame
+AudioFrame
 SndfileDecoder::audio_length () const
 {
        return _info.frames;
@@ -123,6 +123,8 @@ void
 SndfileDecoder::seek (ContentTime t, bool accurate)
 {
        Decoder::seek (t, accurate);
-       
-       /* XXX */
+       AudioDecoder::seek (t, accurate);
+
+       _done = t * audio_frame_rate() / TIME_HZ;
+       _remaining = _info.frames - _done;
 }