projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
A couple of sndfile fixes for the new world order.
[dcpomatic.git]
/
src
/
lib
/
sndfile_decoder.cc
diff --git
a/src/lib/sndfile_decoder.cc
b/src/lib/sndfile_decoder.cc
index e10f4f568430d08dd86d1d5db38d2116606fbbbb..432f73f0d66f5b30e6c8068a13266719cf9c197b 100644
(file)
--- a/
src/lib/sndfile_decoder.cc
+++ b/
src/lib/sndfile_decoder.cc
@@
-55,9
+55,13
@@
SndfileDecoder::~SndfileDecoder ()
delete[] _deinterleave_buffer;
}
delete[] _deinterleave_buffer;
}
-void
+bool
SndfileDecoder::pass ()
{
SndfileDecoder::pass ()
{
+ if (_remaining == 0) {
+ return true;
+ }
+
/* Do things in half second blocks as I think there may be limits
to what FFmpeg (and in particular the resampler) can cope with.
*/
/* Do things in half second blocks as I think there may be limits
to what FFmpeg (and in particular the resampler) can cope with.
*/
@@
-90,9
+94,11
@@
SndfileDecoder::pass ()
}
data->set_frames (this_time);
}
data->set_frames (this_time);
- audio (data, _done);
+ audio (data, _done
* TIME_HZ / audio_frame_rate ()
);
_done += this_time;
_remaining -= this_time;
_done += this_time;
_remaining -= this_time;
+
+ return true;
}
int
}
int
@@
-113,8
+119,11
@@
SndfileDecoder::audio_frame_rate () const
return _info.samplerate;
}
return _info.samplerate;
}
-bool
-SndfileDecoder::
done () const
+void
+SndfileDecoder::
seek (ContentTime t, bool accurate)
{
{
- return _audio_position >= _sndfile_content->audio_length ();
+ Decoder::seek (t, accurate);
+
+ _done = t * audio_frame_rate() / TIME_HZ;
+ _remaining = _info.frames - _done;
}
}