Don't destroy wxFileDialog before reading from it.
[dcpomatic.git] / src / wx / film_viewer.cc
index 00aa6bef3848e156034300d1d092d17789c24d17..03e8419a091f16b5fa95c7085af4f376824ff5a9 100644 (file)
@@ -120,8 +120,7 @@ FilmViewer::set_film (shared_ptr<Film> f)
        _film = f;
 
        _frame.reset ();
-       _queue.clear ();
-
+       
        _slider->SetValue (0);
        set_position_text (0);
        
@@ -286,12 +285,6 @@ FilmViewer::process_video (shared_ptr<const Image> image, Eyes eyes, Time t)
                return;
        }
        
-       if (_got_frame) {
-               /* This is an additional frame emitted by a single pass.  Store it. */
-               _queue.push_front (make_pair (image, t));
-               return;
-       }
-       
        _frame = image;
        _got_frame = true;
 
@@ -335,21 +328,16 @@ FilmViewer::fetch_next_frame ()
 
        _got_frame = false;
        
-       if (!_queue.empty ()) {
-               process_video (_queue.back().first, EYES_BOTH, _queue.back().second);
-               _queue.pop_back ();
-       } else {
-               try {
-                       while (!_got_frame && !_player->pass ()) {}
-               } catch (DecodeError& e) {
-                       _play_button->SetValue (false);
-                       check_play_state ();
-                       error_dialog (this, wxString::Format (_("Could not decode video for view (%s)"), std_to_wx(e.what()).data()));
-               } catch (OpenFileError& e) {
-                       /* There was a problem opening a content file; we'll let this slide as it
-                          probably means a missing content file, which we're already taking care of.
-                       */
-               }
+       try {
+               while (!_got_frame && !_player->pass ()) {}
+       } catch (DecodeError& e) {
+               _play_button->SetValue (false);
+               check_play_state ();
+               error_dialog (this, wxString::Format (_("Could not decode video for view (%s)"), std_to_wx(e.what()).data()));
+       } catch (OpenFileError& e) {
+               /* There was a problem opening a content file; we'll let this slide as it
+                  probably means a missing content file, which we're already taking care of.
+               */
        }
 
        _panel->Refresh ();