Only warn about lots of frame drops in the player (#2069).
authorCarl Hetherington <cth@carlh.net>
Mon, 16 Aug 2021 22:25:09 +0000 (00:25 +0200)
committerCarl Hetherington <cth@carlh.net>
Mon, 16 Aug 2021 22:25:09 +0000 (00:25 +0200)
src/tools/dcpomatic_player.cc
src/wx/film_viewer.cc
src/wx/film_viewer.h

index 112f2c0654b463ef711d414188a7cf9605f7fdac..7ffb107bfc6bd8fdafff3b839530cae40dd2cfee 100644 (file)
@@ -33,6 +33,7 @@
 #include "wx/system_information_dialog.h"
 #include "wx/player_stress_tester.h"
 #include "wx/verify_dcp_progress_dialog.h"
+#include "wx/nag_dialog.h"
 #include "lib/cross.h"
 #include "lib/config.h"
 #include "lib/util.h"
@@ -210,6 +211,7 @@ public:
                _viewer->PlaybackPermitted.connect (bind(&DOMFrame::playback_permitted, this));
                _viewer->Started.connect (bind(&DOMFrame::playback_started, this, _1));
                _viewer->Stopped.connect (bind(&DOMFrame::playback_stopped, this, _1));
+               _viewer->TooManyDropped.connect (bind(&DOMFrame::too_many_frames_dropped, this));
                _info = new PlayerInformation (_overall_panel, _viewer);
                setup_main_sizer (Config::instance()->player_mode());
 #ifdef __WXOSX__
@@ -347,6 +349,25 @@ public:
                _controls->log (wxString::Format("playback-stopped %s", time.timecode(_film->video_frame_rate()).c_str()));
        }
 
+
+       void too_many_frames_dropped ()
+       {
+               if (!Config::instance()->nagged(Config::NAG_TOO_MANY_DROPPED_FRAMES)) {
+                       _viewer->stop ();
+               }
+
+               NagDialog::maybe_nag (
+                       this,
+                       Config::NAG_TOO_MANY_DROPPED_FRAMES,
+                       _("The player is dropping a lot of frames, so playback may not be accurate.\n\n"
+                         "<b>This does not necessarily mean that the DCP you are playing is defective!</b>\n\n"
+                         "You may be able to improve player performance by:\n"
+                         "• choosing 'decode at half resolution' or 'decode at quarter resolution' from the View menu\n"
+                         "• using a more powerful computer.\n"
+                        )
+                       );
+       }
+
        void set_decode_reduction (optional<int> reduction)
        {
                _viewer->set_dcp_decode_reduction (reduction);
index 4ea2a8b006b4a1fee6cac30e4c04fda735d00d52..17649d450e16e8b650f5bef2b1de5d21554a06ee 100644 (file)
@@ -104,7 +104,7 @@ FilmViewer::FilmViewer (wxWindow* p)
        }
 
        _video_view->Sized.connect (boost::bind(&FilmViewer::video_view_sized, this));
-       _video_view->TooManyDropped.connect (boost::bind(&FilmViewer::too_many_frames_dropped, this));
+       _video_view->TooManyDropped.connect (boost::bind(boost::ref(TooManyDropped)));
 
        set_film (shared_ptr<Film>());
 
@@ -770,23 +770,3 @@ FilmViewer::image_changed (shared_ptr<PlayerVideo> pv)
 {
        emit (boost::bind(boost::ref(ImageChanged), pv));
 }
-
-
-void
-FilmViewer::too_many_frames_dropped ()
-{
-       if (!Config::instance()->nagged(Config::NAG_TOO_MANY_DROPPED_FRAMES)) {
-               stop ();
-       }
-
-       NagDialog::maybe_nag (
-               panel(),
-               Config::NAG_TOO_MANY_DROPPED_FRAMES,
-               _("The player is dropping a lot of frames, so playback may not be accurate.\n\n"
-                 "<b>This does not necessarily mean that the DCP you are playing is defective!</b>\n\n"
-                 "You may be able to improve player performance by:\n"
-                 "• choosing 'decode at half resolution' or 'decode at quarter resolution' from the View menu\n"
-                 "• using a more powerful computer.\n"
-                )
-               );
-}
index 0f99675191ef617101b35aaff0b411775d9e0201..2efe448c9e4deeaa37ba58e73e1511cf3ae48ee8 100644 (file)
@@ -145,6 +145,8 @@ public:
        boost::signals2::signal<void (dcpomatic::DCPTime)> Stopped;
        /** While playing back we reached the end of the film (emitted from GUI thread) */
        boost::signals2::signal<void ()> Finished;
+       /** Emitted from the GUI thread when a lot of frames are being dropped */
+       boost::signals2::signal<void()> TooManyDropped;
 
        boost::signals2::signal<bool ()> PlaybackPermitted;
 
@@ -161,7 +163,6 @@ private:
        void config_changed (Config::Property);
        void film_length_change ();
        void ui_finished ();
-       void too_many_frames_dropped ();
 
        dcpomatic::DCPTime uncorrected_time () const;
        Frame average_latency () const;