Fix some warnings (part of #1135).
[dcpomatic.git] / src / lib / player_video.cc
index b7fb52e3aa8d8b2c27645a5688b5c96aae62bf06..14291fc35c917d068b74f4ba9726915402663523 100644 (file)
@@ -99,6 +99,8 @@ PlayerVideo::set_subtitle (PositionImage image)
  *  @param pixel_format Function which is called to decide what pixel format the output image should be;
  *  it is passed the pixel format of the input image from the ImageProxy, and should return the desired
  *  output pixel format.  Two functions always_rgb and keep_xyz_or_rgb are provided for use here.
+ *  @param aligned true if the output image should be aligned to 32-byte boundaries.
+ *  @param fast true to be fast at the expense of quality.
  */
 shared_ptr<Image>
 PlayerVideo::image (dcp::NoteHandler note, function<AVPixelFormat (AVPixelFormat)> pixel_format, bool aligned, bool fast) const
@@ -133,7 +135,7 @@ PlayerVideo::image (dcp::NoteHandler note, function<AVPixelFormat (AVPixelFormat
                );
 
        if (_subtitle) {
-               out->alpha_blend (_subtitle->image, _subtitle->position);
+               out->alpha_blend (Image::ensure_aligned (_subtitle->image), _subtitle->position);
        }
 
        if (_fade) {
@@ -244,3 +246,9 @@ PlayerVideo::keep_xyz_or_rgb (AVPixelFormat p)
 {
        return p == AV_PIX_FMT_XYZ12LE ? AV_PIX_FMT_XYZ12LE : AV_PIX_FMT_RGB48LE;
 }
+
+void
+PlayerVideo::prepare ()
+{
+       _in->prepare (_inter_size);
+}