Actually use YUV->RGB setting when converting.
[dcpomatic.git] / src / lib / player_video.cc
index f9f06f63aee7fb48743ad3fa457faca0f4ac9baa..81e01329a5b641ac1869d2f158b645375d364bd1 100644 (file)
 
 */
 
-#include <dcp/raw_convert.h>
 #include "player_video.h"
 #include "image.h"
 #include "image_proxy.h"
 #include "j2k_image_proxy.h"
 #include "film.h"
+#include "raw_convert.h"
 
 using std::string;
 using std::cout;
-using dcp::raw_convert;
 using boost::shared_ptr;
 using boost::dynamic_pointer_cast;
 using boost::optional;
@@ -111,8 +110,13 @@ PlayerVideo::image (AVPixelFormat pixel_format, bool burn_subtitle, dcp::NoteHan
        default:
                break;
        }
+
+       dcp::YUVToRGB yuv_to_rgb = dcp::YUV_TO_RGB_REC601;
+       if (_colour_conversion) {
+               yuv_to_rgb = _colour_conversion.get().yuv_to_rgb();
+       }
                
-       shared_ptr<Image> out = im->crop_scale_window (total_crop, _inter_size, _out_size, pixel_format, true);
+       shared_ptr<Image> out = im->crop_scale_window (total_crop, _inter_size, _out_size, yuv_to_rgb, pixel_format, true);
 
        if (burn_subtitle && _subtitle.image) {
                out->alpha_blend (_subtitle.image, _subtitle.position);