A couple of sndfile fixes for the new world order.
[dcpomatic.git] / src / lib / sndfile_decoder.cc
index 3af683c570a89b21a59cf6fd68d8a9f6d37d3fb7..432f73f0d66f5b30e6c8068a13266719cf9c197b 100644 (file)
@@ -94,7 +94,7 @@ SndfileDecoder::pass ()
        }
                
        data->set_frames (this_time);
-       audio (data, _done);
+       audio (data, _done * TIME_HZ / audio_frame_rate ());
        _done += this_time;
        _remaining -= this_time;
 
@@ -123,6 +123,7 @@ void
 SndfileDecoder::seek (ContentTime t, bool accurate)
 {
        Decoder::seek (t, accurate);
-       
-       /* XXX */
+
+       _done = t * audio_frame_rate() / TIME_HZ;
+       _remaining = _info.frames - _done;
 }