Further fixes and tidying to 'better-seek'.
[dcpomatic.git] / src / lib / decoder.cc
index b7bd78c1404415e6b61c11940d4ccae67502b8d2..e538a51d4af06a65c718e4eae0a5c8dfee46c993 100644 (file)
 */
 
 #include "decoder.h"
+#include "decoder_part.h"
 #include <iostream>
 
 using std::cout;
 using boost::optional;
 
 void
-Decoder::maybe_seek (optional<ContentTime>& position, ContentTime time, bool accurate)
+Decoder::maybe_seek (opional<ContentTime> position, ContentTime time, bool accurate)
 {
-       if (position && (time >= *position && time < (*position + ContentTime::from_seconds(1)))) {
+       if (position && (time >= position.get() && time < (position.get() + ContentTime::from_seconds(1)))) {
                /* No need to seek: caller should just pass() */
                return;
        }
 
-       position.reset ();
        seek (time, accurate);
 }