summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-04-14 22:16:27 +0200
committerCarl Hetherington <cth@carlh.net>2020-04-14 22:16:27 +0200
commit4ab86ef0295bcd6bb9297996a06006f371d22bae (patch)
treefefc1706a67a10f6aa1a7c5d576e5cb8826ce950 /src/wx
parent3b31d2d8a129ae6d8d267427bd6b5bc444b40b2a (diff)
Ignore and report failures to decode frames during playback (#1593).
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/film_viewer.cc8
-rw-r--r--src/wx/film_viewer.h1
-rw-r--r--src/wx/player_information.cc8
-rw-r--r--src/wx/video_view.cc6
-rw-r--r--src/wx/video_view.h6
5 files changed, 28 insertions, 1 deletions
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index 9c3a9c81e..c020a3baf 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -679,6 +679,14 @@ FilmViewer::dropped () const
return _video_view->dropped ();
}
+
+int
+FilmViewer::errored () const
+{
+ return _video_view->errored ();
+}
+
+
int
FilmViewer::gets () const
{
diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h
index 60cde60d0..c54ff6eb4 100644
--- a/src/wx/film_viewer.h
+++ b/src/wx/film_viewer.h
@@ -96,6 +96,7 @@ public:
boost::optional<dcpomatic::DCPTime> audio_time () const;
int dropped () const;
+ int errored () const;
int gets () const;
int audio_callback (void* out, unsigned int frames);
diff --git a/src/wx/player_information.cc b/src/wx/player_information.cc
index 5f480d5b4..9a569c00c 100644
--- a/src/wx/player_information.cc
+++ b/src/wx/player_information.cc
@@ -90,7 +90,13 @@ PlayerInformation::periodic_update ()
{
shared_ptr<FilmViewer> fv = _viewer.lock ();
if (fv) {
- checked_set (_dropped, wxString::Format(_("Dropped frames: %d"), fv->dropped()));
+ wxString s = wxString::Format(_("Dropped frames: %d"), fv->dropped() + fv->errored());
+ if (fv->errored() == 1) {
+ s += wxString::Format(_(" (%d error)"), fv->errored());
+ } else if (fv->errored() > 1) {
+ s += wxString::Format(_(" (%d errors)"), fv->errored());
+ }
+ checked_set (_dropped, s);
}
}
diff --git a/src/wx/video_view.cc b/src/wx/video_view.cc
index 014524757..b9c45631e 100644
--- a/src/wx/video_view.cc
+++ b/src/wx/video_view.cc
@@ -38,6 +38,7 @@ VideoView::VideoView (FilmViewer* viewer)
, _eyes (EYES_LEFT)
, _three_d (false)
, _dropped (0)
+ , _errored (0)
, _gets (0)
{
@@ -83,6 +84,10 @@ VideoView::get_next_frame (bool non_blocking)
_player_video.first->eyes() != EYES_BOTH
);
+ if (_player_video.first && _player_video.first->error()) {
+ ++_errored;
+ }
+
return true;
}
@@ -114,6 +119,7 @@ VideoView::start ()
{
boost::mutex::scoped_lock lm (_mutex);
_dropped = 0;
+ _errored = 0;
}
bool
diff --git a/src/wx/video_view.h b/src/wx/video_view.h
index f9e067043..50ea40fc7 100644
--- a/src/wx/video_view.h
+++ b/src/wx/video_view.h
@@ -66,6 +66,11 @@ public:
return _dropped;
}
+ int errored () const {
+ boost::mutex::scoped_lock lm (_mutex);
+ return _errored;
+ }
+
int gets () const {
boost::mutex::scoped_lock lm (_mutex);
return _gets;
@@ -157,6 +162,7 @@ private:
bool _three_d;
int _dropped;
+ int _errored;
int _gets;
};