Fix incorrect video waveform display (#1425).
authorCarl Hetherington <cth@carlh.net>
Sun, 6 Jan 2019 18:55:19 +0000 (18:55 +0000)
committerCarl Hetherington <cth@carlh.net>
Sun, 6 Jan 2019 18:55:19 +0000 (18:55 +0000)
ChangeLog
src/wx/video_waveform_plot.cc

index 5bc7bf7..1f87ca8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2019-01-06  Carl Hetherington  <cth@carlh.net>
+
+       * Fix incorrect video waveform display (#1425).
+
 2019-01-05  Carl Hetherington  <cth@carlh.net>
 
        * Fix strange behaviour with single-frame fades.
index 9f71140..c6fa883 100644 (file)
@@ -24,6 +24,7 @@
 #include "lib/image.h"
 #include "lib/film.h"
 #include "lib/dcp_video.h"
+#include "lib/player_video.h"
 #include <dcp/locale_convert.h>
 #include <dcp/openjpeg_image.h>
 #include <wx/rawbmp.h>
@@ -193,7 +194,11 @@ VideoWaveformPlot::set_image (weak_ptr<PlayerVideo> image)
        }
 
        shared_ptr<PlayerVideo> pv = image.lock ();
-       _image = DCPVideo::convert_to_xyz (pv, boost::bind (&note));
+       DCPOMATIC_ASSERT (pv);
+       /* We must copy the PlayerVideo here as we will call ::image() on it, potentially
+          with a different pixel_format than was used when ::prepare() was called.
+       */
+       _image = DCPVideo::convert_to_xyz (pv->shallow_copy(), boost::bind (&note));
        _dirty = true;
        Refresh ();
 }