Store audio/video even when suspended.
authorCarl Hetherington <cth@carlh.net>
Tue, 11 Sep 2018 10:42:40 +0000 (11:42 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 11 Sep 2018 10:42:40 +0000 (11:42 +0100)
This is important for audio.  _audio.put() must be called with
sequential data, so if you're going to discard audio (as was
happening when _suspended) you need to clear _audio before
put()ting any more.

This happens with seek; when _pending_seek_position is set
_audio is cleared and then nothing more is added until the
seek is done.

_suspended may be set and then reset with no change having
happened (type _CANCELLED) so I think you have to keep storing
data in this case.  It will be discarded when the seek comes
around after a _DONE change.

src/lib/butler.cc

index 3e408c4d52e852e19e853a83087e0f477c9b9c7b..191bb0a5b68b52b006d8e300bb1002d40fb7f49f 100644 (file)
@@ -270,8 +270,8 @@ Butler::video (shared_ptr<PlayerVideo> video, DCPTime time)
 {
        boost::mutex::scoped_lock lm (_mutex);
 
-       if (_pending_seek_position || _suspended) {
-               /* Don't store any video in these cases */
+       if (_pending_seek_position) {
+               /* Don't store any video in this case */
                return;
        }
 
@@ -286,7 +286,7 @@ Butler::audio (shared_ptr<AudioBuffers> audio, DCPTime time)
 {
        {
                boost::mutex::scoped_lock lm (_mutex);
-               if (_pending_seek_position || _disable_audio || _suspended) {
+               if (_pending_seek_position || _disable_audio) {
                        /* Don't store any audio in these cases */
                        return;
                }