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 5bc7bf760375b92a02b440cdc9458c45d3121827..1f87ca82e4374e4df5bca8387057673e7ecb58a1 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 9f71140f308345526e5964f9fb96657de120d7fb..c6fa883fa871c227b321dea92819d126998cd922 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 ();
 }